From 6c67d4612472966a1e1de925554f28905ee86e2d Mon Sep 17 00:00:00 2001 From: hubin Date: Fri, 22 Nov 2024 22:01:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=201.0.6=20=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- changelog.md | 22 +++++++++++++++++++ .../com/aizuda/bpm/engine/FlowLongEngine.java | 7 +++++- .../com/aizuda/bpm/engine/TaskService.java | 2 +- .../bpm/engine/core/FlowLongEngineImpl.java | 10 +-------- .../bpm/engine/core/enums/TaskEventType.java | 4 ++++ .../bpm/engine/core/enums/TaskType.java | 6 ++++- .../bpm/engine/impl/TaskServiceImpl.java | 14 +++++++++--- .../aizuda/bpm/engine/model/NodeModel.java | 5 +++-- gradle.properties | 2 +- pom.xml | 2 +- 11 files changed, 57 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 1865e227..38ef1e92 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ FlowLong🐉飞龙工作流 - 项目说明 `flowlong` 中文名 `飞龙` 在天美好愿景! -> ⭕本项目采用 `Apache-2.0` 协议开源`完全开放`允许任何目的商用,使用方必须标注版权信息,否则视为侵权。 +> ⭕本项目采用 `Apache-2.0` 协议开源`完全开放`允许任何目的商用, +> 附加要求:使用方在项目介绍中显著位置`必须标注`版权信息`(链接仓库地址)`,不允许删除`源码注释申明`,否则视为侵权`(索赔100万)`。 > 使用必须遵守国家法律法规,⛔不允许非法项目使用,后果自负❗ diff --git a/changelog.md b/changelog.md index 7076e56d..e4e0a12d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,27 @@ # 更新日志 +## [v1.0.6] 2024.11.22 + +- feat: 修改为 apache 2.0 协议开源 +- feat: 新增支持路由分支 +- feat: 新增支持可视化配置驳回策略 +- feat: 支持可视化自选候选人角色部门等 +- feat: 支持可指定节点驳回跳转 +- feat: 支持结束流程历史任务唤醒 +- feat: 支持根据实例ID删除任务实例相关表记录 +- feat: 支持获取当前已使用的节点key列表 +- feat: 新增task同步监听注释说明 +- feat: 新增根据流程实例ID更新流程全局变量方法 +- opt: 调整保存任务参与者优先以数据库为准 +- opt: 优化更新流程全局变量方法 +- opt: 优化自定义CreateTaskHandler控制任务创建属性设置 +- opt: 优化优化转办,委派 分配默认强制分配 +- opt: 优化增加超时自动审批功能 +- opt: 优化pom文件引入依赖配置 +- fix: 修复流程撤回唤醒bug +- fix: 修复角色顺序签bug +- fix: 修复TaskState.get 使用Optional取值代码使用有问题,会造成空指针异常 + ## [v1.0.5] 2024.10.27 - 支持自定义解决无任务参与者情况 diff --git a/flowlong-core/src/main/java/com/aizuda/bpm/engine/FlowLongEngine.java b/flowlong-core/src/main/java/com/aizuda/bpm/engine/FlowLongEngine.java index af327f34..56e20d38 100644 --- a/flowlong-core/src/main/java/com/aizuda/bpm/engine/FlowLongEngine.java +++ b/flowlong-core/src/main/java/com/aizuda/bpm/engine/FlowLongEngine.java @@ -216,12 +216,17 @@ default boolean autoRejectTask(FlwTask flwTask) { * @param args 任务参数 * @return true 成功 false 失败 */ - boolean executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map args); + default boolean executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map args) { + // 执行任务跳转归档 + return this.executeJumpTask(taskId, nodeKey, flowCreator, args, TaskType.jump).isPresent(); + } default boolean executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator) { return executeJumpTask(taskId, nodeKey, flowCreator, null); } + Optional executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map args, TaskType taskTye); + /** * 根据当前任务对象驳回至指定 nodeKey 节点,如果 nodeKey 为空默认为上一步处理 * diff --git a/flowlong-core/src/main/java/com/aizuda/bpm/engine/TaskService.java b/flowlong-core/src/main/java/com/aizuda/bpm/engine/TaskService.java index 79034414..67a6bf49 100644 --- a/flowlong-core/src/main/java/com/aizuda/bpm/engine/TaskService.java +++ b/flowlong-core/src/main/java/com/aizuda/bpm/engine/TaskService.java @@ -81,7 +81,7 @@ default FlwTask complete(Long taskId, FlowCreator flowCreator) { * @param args 任务参数 * @param nodeKey 跳转至目标节点key * @param executionFunction 执行函数 - * @param taskTye 任务类型,仅支持 jump 或 rejectJump + * @param taskTye 任务类型,仅支持 jump rejectJump routeJump * @return 当前 flowCreator 所在的任务 */ Optional executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map args, Function executionFunction, TaskType taskTye); diff --git a/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/FlowLongEngineImpl.java b/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/FlowLongEngineImpl.java index 71b6e560..f094118e 100644 --- a/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/FlowLongEngineImpl.java +++ b/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/FlowLongEngineImpl.java @@ -163,16 +163,8 @@ public boolean autoRejectTask(FlwTask flwTask, Map args) { return flwTaskOptional.isPresent(); } - /** - * 执行任务并跳转到指定节点 - */ @Override - public boolean executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map args) { - // 执行任务跳转归档 - return this.executeJumpTask(taskId, nodeKey, flowCreator, args, TaskType.jump).isPresent(); - } - - protected Optional executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map args, TaskType taskTye) { + public Optional executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map args, TaskType taskTye) { // 执行任务跳转归档 return taskService().executeJumpTask(taskId, nodeKey, flowCreator, args, flwTask -> { FlwInstance flwInstance = this.getFlwInstance(flwTask.getInstanceId(), flowCreator.getCreateBy()); diff --git a/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/enums/TaskEventType.java b/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/enums/TaskEventType.java index 64859583..7f4cd5cc 100644 --- a/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/enums/TaskEventType.java +++ b/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/enums/TaskEventType.java @@ -111,6 +111,10 @@ public enum TaskEventType { * 驳回跳转 */ rejectJump, + /** + * 路由跳转 + */ + routeJump, /** * 自动审批完成 */ diff --git a/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/enums/TaskType.java b/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/enums/TaskType.java index 2c06af2e..10a7de57 100644 --- a/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/enums/TaskType.java +++ b/flowlong-core/src/main/java/com/aizuda/bpm/engine/core/enums/TaskType.java @@ -114,10 +114,14 @@ public enum TaskType { * 驳回跳转 */ rejectJump(21), + /** + * 路由跳转 + */ + routeJump(22), /** * 路由分支 */ - routeBranch(22); + routeBranch(23); private final int value; diff --git a/flowlong-core/src/main/java/com/aizuda/bpm/engine/impl/TaskServiceImpl.java b/flowlong-core/src/main/java/com/aizuda/bpm/engine/impl/TaskServiceImpl.java index 25eed30d..0746b5ca 100644 --- a/flowlong-core/src/main/java/com/aizuda/bpm/engine/impl/TaskServiceImpl.java +++ b/flowlong-core/src/main/java/com/aizuda/bpm/engine/impl/TaskServiceImpl.java @@ -138,8 +138,16 @@ public boolean forceCompleteAllTask(Long instanceId, FlowCreator flowCreator, In */ @Override public Optional executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map args, - Function executionFunction, TaskType taskTye) { - Assert.illegal(taskTye != TaskType.jump && taskTye != TaskType.rejectJump, "taskTye only allow jump and rejectJump"); + Function executionFunction, TaskType taskTye) { + TaskEventType taskEventType = null; + if (taskTye == TaskType.jump) { + taskEventType = TaskEventType.jump; + } else if (taskTye == TaskType.rejectJump) { + taskEventType = TaskEventType.rejectJump; + } else if (taskTye == TaskType.routeJump) { + taskEventType = TaskEventType.routeJump; + } + Assert.illegal(null == taskEventType,"taskTye only allow jump and rejectJump"); FlwTask flwTask = this.getAllowedFlwTask(taskId, flowCreator, null, null); // 执行跳转到目标节点 @@ -183,7 +191,7 @@ public Optional executeJumpTask(Long taskId, String nodeKey, FlowCreato } // 任务监听器通知 - this.taskNotify(taskTye == TaskType.jump ? TaskEventType.jump : TaskEventType.rejectJump, () -> flwTask, nodeModel, flowCreator); + this.taskNotify(taskEventType, () -> flwTask, nodeModel, flowCreator); return Optional.of(createTask); } diff --git a/flowlong-core/src/main/java/com/aizuda/bpm/engine/model/NodeModel.java b/flowlong-core/src/main/java/com/aizuda/bpm/engine/model/NodeModel.java index a0b9f1a9..6f7e0036 100644 --- a/flowlong-core/src/main/java/com/aizuda/bpm/engine/model/NodeModel.java +++ b/flowlong-core/src/main/java/com/aizuda/bpm/engine/model/NodeModel.java @@ -64,7 +64,7 @@ public class NodeModel implements ModelInstance, Serializable { /** * 节点类型 *

- * -1,结束节点 0,发起人 1,审批人 2,抄送人 3,条件审批 4,条件分支 5,办理子流程 6,定时器任务 7,触发器任务 8,并发分支 9,包容分支 22,路由分支 + * -1,结束节点 0,发起人 1,审批人 2,抄送人 3,条件审批 4,条件分支 5,办理子流程 6,定时器任务 7,触发器任务 8,并发分支 9,包容分支 23,路由分支 *

*/ private Integer type; @@ -277,7 +277,8 @@ public boolean execute(FlowLongContext flowLongContext, Execution execution) { flowLongContext.getFlowConditionHandler() .getConditionNode(flowLongContext, execution, this) // 自动跳转到指定节点 - .ifPresent(t -> execution.getEngine().executeJumpTask(execution.getFlwTask().getId(), t.getNodeKey(), execution.getFlowCreator())); + .ifPresent(t -> execution.getEngine().executeJumpTask(execution.getFlwTask().getId(), t.getNodeKey(), + execution.getFlowCreator(), execution.getArgs(), TaskType.rejectJump)); return true; } diff --git a/gradle.properties b/gradle.properties index 1f7ad4dd..074a2803 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ APP_GROUP=com.aizuda -APP_VERSION=1.0.5 +APP_VERSION=1.0.6 SONATYPE_HOST=CENTRAL_PORTAL RELEASE_SIGNING_ENABLED=true diff --git a/pom.xml b/pom.xml index 23005f33..097eb236 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ - 1.0.5 + 1.0.6 8 8 2.7.0