修复抄送后连续创建任务bug

This commit is contained in:
hubin 2024-12-20 22:49:15 +08:00
parent 4fb37d39cd
commit 54e0e2c667
2 changed files with 9 additions and 15 deletions

View File

@ -920,7 +920,14 @@ public class TaskServiceImpl implements TaskService {
/*
* 可能存在子节点
*/
nodeModel.nextNode().ifPresent(nextNode -> nextNode.execute(execution.getEngine().getContext(), execution));
Optional<NodeModel> nextNodeOptional = nodeModel.nextNode();
if (nextNodeOptional.isPresent()) {
// 执行下一个节点
nextNodeOptional.get().execute(execution.getEngine().getContext(), execution);
} else {
// 不存在任何子节点结束流程
execution.endInstance(nodeModel);
}
} else if (TaskType.conditionNode.eq(nodeType)) {
/*
* 3条件审批

View File

@ -295,20 +295,7 @@ public class NodeModel implements ModelInstance, Serializable {
|| TaskType.trigger.eq(this.type)) {
// 创建任务
if (flowLongContext.createTask(execution, this)) {
// 抄送任务需要继续往下执行
if (TaskType.cc.eq(this.type)) {
Optional<NodeModel> nextNodeOptional = this.nextNode();
if (nextNodeOptional.isPresent()) {
// 执行下一个节点
flowLongContext.createTask(execution, nextNodeOptional.get());
} else {
// 不存在任何子节点结束流程
execution.endInstance(this);
}
}
}
flowLongContext.createTask(execution, this);
}
/*