Skip to content

Commit

Permalink
发布 1.0.6 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
qmdx committed Nov 22, 2024
1 parent b21e4e4 commit 6c67d46
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 20 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ FlowLong🐉飞龙工作流

- 项目说明 `flowlong` 中文名 `飞龙` 在天美好愿景!

> ⭕本项目采用 `Apache-2.0` 协议开源`完全开放`允许任何目的商用,使用方必须标注版权信息,否则视为侵权。
> ⭕本项目采用 `Apache-2.0` 协议开源`完全开放`允许任何目的商用,
> 附加要求:使用方在项目介绍中显著位置`必须标注`版权信息`(链接仓库地址)`,不允许删除`源码注释申明`,否则视为侵权`(索赔100万)`
> 使用必须遵守国家法律法规,⛔不允许非法项目使用,后果自负❗
Expand Down
22 changes: 22 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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

- 支持自定义解决无任务参与者情况
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,17 @@ default boolean autoRejectTask(FlwTask flwTask) {
* @param args 任务参数
* @return true 成功 false 失败
*/
boolean executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> args);
default boolean executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> 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<FlwTask> executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> args, TaskType taskTye);

/**
* 根据当前任务对象驳回至指定 nodeKey 节点,如果 nodeKey 为空默认为上一步处理
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<FlwTask> executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> args, Function<FlwTask, Execution> executionFunction, TaskType taskTye);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,8 @@ public boolean autoRejectTask(FlwTask flwTask, Map<String, Object> args) {
return flwTaskOptional.isPresent();
}

/**
* 执行任务并跳转到指定节点
*/
@Override
public boolean executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> args) {
// 执行任务跳转归档
return this.executeJumpTask(taskId, nodeKey, flowCreator, args, TaskType.jump).isPresent();
}

protected Optional<FlwTask> executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> args, TaskType taskTye) {
public Optional<FlwTask> executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> args, TaskType taskTye) {
// 执行任务跳转归档
return taskService().executeJumpTask(taskId, nodeKey, flowCreator, args, flwTask -> {
FlwInstance flwInstance = this.getFlwInstance(flwTask.getInstanceId(), flowCreator.getCreateBy());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ public enum TaskEventType {
* 驳回跳转
*/
rejectJump,
/**
* 路由跳转
*/
routeJump,
/**
* 自动审批完成
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,14 @@ public enum TaskType {
* 驳回跳转
*/
rejectJump(21),
/**
* 路由跳转
*/
routeJump(22),
/**
* 路由分支
*/
routeBranch(22);
routeBranch(23);

private final int value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,16 @@ public boolean forceCompleteAllTask(Long instanceId, FlowCreator flowCreator, In
*/
@Override
public Optional<FlwTask> executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> args,
Function<FlwTask, Execution> executionFunction, TaskType taskTye) {
Assert.illegal(taskTye != TaskType.jump && taskTye != TaskType.rejectJump, "taskTye only allow jump and rejectJump");
Function<FlwTask, Execution> 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);

// 执行跳转到目标节点
Expand Down Expand Up @@ -183,7 +191,7 @@ public Optional<FlwTask> 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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class NodeModel implements ModelInstance, Serializable {
/**
* 节点类型
* <p>
* -1,结束节点 0,发起人 1,审批人 2,抄送人 3,条件审批 4,条件分支 5,办理子流程 6,定时器任务 7,触发器任务 8,并发分支 9,包容分支 22,路由分支
* -1,结束节点 0,发起人 1,审批人 2,抄送人 3,条件审批 4,条件分支 5,办理子流程 6,定时器任务 7,触发器任务 8,并发分支 9,包容分支 23,路由分支
* </p>
*/
private Integer type;
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</modules>

<properties>
<revision>1.0.5</revision>
<revision>1.0.6</revision>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<spring-boot.version>2.7.0</spring-boot.version>
Expand Down

0 comments on commit 6c67d46

Please sign in to comment.