# light-flow-engine **Repository Path**: yaoyueyi/light-flow-engine ## Basic Information - **Project Name**: light-flow-engine - **Description**: 轻量级流程引擎,借鉴flowable简化设计 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-05-28 - **Last Updated**: 2025-05-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # light-flow-engine #### 介绍 :tw-1f50b: 轻量级流程引擎,借鉴flowable简化设计。 在以往的项目中使用过成熟的开源流程引擎Flowable,由于Flowable过于繁重,整合Flowable到项目中不仅难度较高,还会引入很多使用不上的功能。 轻量级流程引擎由此诞生,保留了流程创建、流程流转、流程生命周期管理等基本功能,将用户组权限管理功能移交到前置系统。 #### 软件架构 基于springboot、mybatis、cola,参考flowable流程引擎简化设计 #### 启动参数 -Djasypt.encryptor.password=magic #### 支持命令 ``` COMPLETE("COMPLETE", "通过"), CANCEL("CANCEL", "不通过"), TRANSFER("TRANSFER", "转办"), FALLBACK("FALLBACK", "回退"), COUNTERSIGN("COUNTERSIGN", "加签"), DELEGATE("DELEGATE", "委派(新增节点,办完回到当前节点)") ``` #### 设计思路 ##### 一、创建流程模版
![输入图片说明](light-flow-engine-service/doc/process.png)
创建流程模版请求参数: ``` { "processName": "测试流程", "processKey": "firstKey", "stepNum": "4", "crtUser": "admin", "stepList": [ { "nodeType": "0", "stepIdx": "1", "nextStepIdx": "2;3", "stepType": "0", "stepName": "节点1" }, { "nodeType": "1", "stepIdx": "2", "nextStepIdx": "4", "stepType": "0", "stepName": "节点2" }, { "nodeType": "1", "stepIdx": "3", "nextStepIdx": "4", "stepType": "0", "stepName": "节点3" }, { "nodeType": "2", "stepIdx": "4", "nextStepIdx": "4", "stepType": "0", "stepName": "节点4" } ] } ``` ##### 二、根据模版发起流程实例并绑定业务job ![发起流程实例](light-flow-engine-service/doc/inst.png)
``` 发起流程请求参数: { "processKey": "firstKey", "instName": "车费报销流程", "address": "https://127.0.0.1:8080/pay", "bizParams": "{\"name\":\"zhangsan\",\"amt\":\"1000\"}", "crtUser": "ys", "taskList": [ { "taskIdx": "1", "taskName": "初审" }, { "taskIdx": "2", "taskName": "李经理审批", "userNo": "lijingli" }, { "taskIdx": "3", "taskName": "王经理审批", "userNo": "wangjingli" }, { "taskIdx": "4", "taskName": "部门领导终审" } ] } ``` ##### 三、办理任务流转流程实例
任务办理接口发送审批通过指令后流转
![task1](light-flow-engine-service/doc/task1.png) ![task2](light-flow-engine-service/doc/task2.png) ![task3](light-flow-engine-service/doc/task3.png) ![task4](light-flow-engine-service/doc/task4.png)
任务办理后,删除活跃任务表记录,迁移至历史任务表
![task5](light-flow-engine-service/doc/task5.png) ``` { "taskId": "5", "commentType": "COMPLETE", "userNo": "ys", "message": "审批通过" } { "taskId": "7", "commentType": "COMPLETE", "userNo": "wangjingli", "message": "审批通过" } { "taskId": "8", "commentType": "COMPLETE", "userNo": "ys", "message": "通过" } ``` #### 参与贡献 1. ys