review: 流程发起时,只预测类型为发起人自选的节点信息

This commit is contained in:
smallNorthLee 2025-03-04 23:18:19 +08:00
parent ebd722cb41
commit 1e3fd24d65
2 changed files with 5 additions and 2 deletions

View File

@ -65,9 +65,8 @@ public class BpmTaskCandidateApproveUserSelectStrategy extends AbstractBpmTaskCa
if (processVariables == null) {
return Sets.newLinkedHashSet();
}
// 流程预测时会使用允许审批人为空如果为空前端会弹出提示选择下一个节点审批人避免流程无法进行审批时会真正校验节点是否配置审批人
Map<String, List<Long>> approveUserSelectAssignees = FlowableUtils.getApproveUserSelectAssignees(processVariables);
Assert.notNull(approveUserSelectAssignees, "流程实例节点({}) 的下一个执行节点审批人不能为空",
activityId);
if (approveUserSelectAssignees == null) {
return Sets.newLinkedHashSet();
}

View File

@ -224,6 +224,10 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
List<ActivityNode> simulateActivityNodes = getSimulateApproveNodeList(startUserId, bpmnModel,
processDefinitionInfo,
processVariables, activities);
// 3.3 如果时发起动作,activityId为开始节点不校验审批人自选节点
if (ObjUtil.isNotNull(reqVO.getActivityId()) && ObjUtil.equals(reqVO.getActivityId(),BpmnModelConstants.START_USER_NODE_ID)){
simulateActivityNodes.removeIf(node -> BpmTaskCandidateStrategyEnum.APPROVE_USER_SELECT.getStrategy().equals(node.getCandidateStrategy()));
}
// 4. 拼接最终数据
return buildApprovalDetail(reqVO, bpmnModel, processDefinition, processDefinitionInfo, historicProcessInstance,