springboot 整合 flowable
版本
springboot 2.2.5.RELEASE
flowable 6.4.1
功能点
- 创建流程
- 开启申请流程
- 查看环节
- 完成环节
报销申请接口交互
创建流程
http://localhost:8080/demo/flow/createFlow
{
"flowName": "test4"
}
开启申请流程
http://localhost:8080/demo/flow/startApply
{
"processKey": "test4",
"taskUser":"lizg"
}
返回内容
{
"resultCode": 0,
"resultMsg": "成功",
"object": "{\"processId\":\"5c3ea130-9ad2-11eb-9b23-9a9a92555345\"}"
}
查看环节
GET请求
http://localhost:8080/demo/flow/viewFlow?processId=5c3ea130-9ad2-11eb-9b23-9a9a92555345
经理完成环节
获取taskId
SELECT ID_ as taskId from ACT_RU_TASK WHERE PROC_INST_ID_=‘5c3ea130-9ad2-11eb-9b23-9a9a92555345’;
http://localhost:8080/demo/flow/completeFlow
{
"taskId": "5c3f3d77-9ad2-11eb-9b23-9a9a92555345",
"money":"700"
}
老板完成环节
获取taskId
http://localhost:8080/demo/flow/completeFlow
{
"taskId": "c850571f-9ad2-11eb-9b23-9a9a92555345",
"outcome":"通过"
}
常用sql
-- 创建流程
select * from ACT_RE_DEPLOYMENT;
-- 部署内容
SELECT * from act_ge_bytearray;
-- 流程引擎key
SELECT * from ACT_RE_PROCDEF;
-- 当前任务 ID_为taskId
SELECT ID_ as taskId from ACT_RU_TASK WHERE PROC_INST_ID_='5c3ea130-9ad2-11eb-9b23-9a9a92555345';
-- 当前获得环节 PROC_INST_ID_
SELECT * from ACT_RU_EXECUTION WHERE PROC_INST_ID_='f053e627-9acf-11eb-af59-9a9a92555345';
-- 历史任务
SELECT * from ACT_HI_TASKINST WHERE PROC_INST_ID_='f053e627-9acf-11eb-af59-9a9a92555345';
参考
https://blog.csdn.net/houyj1986/category_9283047.html
开源地址
https://gitee.com/whiteubuntu/flowable-demo