feat:审批通过时,查询下一个执行节点,校验流程执行正确与否

This commit is contained in:
smallNorthLee 2025-03-03 21:24:13 +08:00
parent 33ab961629
commit d41cce94cd
2 changed files with 8 additions and 1 deletions

View File

@ -856,6 +856,10 @@ public class BpmnModelUtils {
if (targetElement == null) {
continue;
}
// 如果是结束节点直接返回
if (targetElement instanceof EndEvent) {
break;
}
// 情况一处理不同类型的网关
if (targetElement instanceof Gateway) {
Gateway gateway = (Gateway) targetElement;

View File

@ -595,8 +595,11 @@ public class BpmTaskServiceImpl implements BpmTaskService {
if (CollUtil.isNotEmpty(allNextAssignees)) {
// 获取实例中的全部节点数据避免后续节点的审批人被覆盖
hisProcessVariables.putAll(allNextAssignees);
// 设置流程变量,审批人自选
newVariables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_APPROVE_USER_SELECT_ASSIGNEES, hisProcessVariables);
runtimeService.setVariables(processInstance.getProcessInstanceId(), variables);
// 设置流程变量,发起人自选后续的节点或者回退后再或者驳回重新发起的场景可能存在发起人自选或者审批人自选所以中两个变量值要保持一致否则会查询不到审批人
newVariables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES, hisProcessVariables);
runtimeService.setVariables(processInstance.getProcessInstanceId(), newVariables);
}
return newVariables;
}