fix 修复获取下一环节排他网关出现条件错误

add 增加示例
This commit is contained in:
gssong
2025-03-08 00:09:08 +08:00
parent 13ac302525
commit 23245b78ca
2 changed files with 214 additions and 2 deletions

View File

@ -578,14 +578,15 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
Task task = taskService.getById(taskId);
Instance instance = insService.getById(task.getInstanceId());
Definition definition = defService.getById(task.getDefinitionId());
Map<String, Object> mergeVariable = MapUtil.mergeAll(instance.getVariableMap(), variables);
//获取下一节点列表
List<Node> nextNodeList = nodeService.getNextNodeList(task.getDefinitionId(), task.getNodeCode(), null, SkipType.PASS.getKey(), variables);
List<Node> nextNodeList = nodeService.getNextNodeList(task.getDefinitionId(), task.getNodeCode(), null, SkipType.PASS.getKey(), mergeVariable);
List<FlowNode> nextFlowNodes = BeanUtil.copyToList(nextNodeList, FlowNode.class);
if (CollUtil.isNotEmpty(nextNodeList)) {
//构建以下节点数据
List<Task> buildNextTaskList = StreamUtils.toList(nextNodeList, node -> taskService.addTask(node, instance, definition, null));
//办理人变量替换
ExpressionUtil.evalVariable(buildNextTaskList, MapUtil.mergeAll(instance.getVariableMap(), variables));
ExpressionUtil.evalVariable(buildNextTaskList, mergeVariable);
for (FlowNode flowNode : nextFlowNodes) {
buildNextTaskList.stream().filter(t -> t.getNodeCode().equals(flowNode.getNodeCode())).findFirst().ifPresent(t -> {
if (CollUtil.isNotEmpty(t.getPermissionList())) {