Commit 1e3fd24d651659cf58fcaa613fb74ea2b93674fc
1 parent
ebd722cb
review: 流程发起时,只预测类型为发起人自选的节点信息
Showing
2 changed files
with
5 additions
and
2 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/candidate/strategy/dept/BpmTaskCandidateApproveUserSelectStrategy.java
| ... | ... | @@ -65,9 +65,8 @@ public class BpmTaskCandidateApproveUserSelectStrategy extends AbstractBpmTaskCa |
| 65 | 65 | if (processVariables == null) { |
| 66 | 66 | return Sets.newLinkedHashSet(); |
| 67 | 67 | } |
| 68 | + // 流程预测时会使用,允许审批人为空,如果为空前端会弹出提示选择下一个节点审批人,避免流程无法进行,审批时会真正校验节点是否配置审批人 | |
| 68 | 69 | Map<String, List<Long>> approveUserSelectAssignees = FlowableUtils.getApproveUserSelectAssignees(processVariables); |
| 69 | - Assert.notNull(approveUserSelectAssignees, "流程实例节点({}) 的下一个执行节点审批人不能为空", | |
| 70 | - activityId); | |
| 71 | 70 | if (approveUserSelectAssignees == null) { |
| 72 | 71 | return Sets.newLinkedHashSet(); |
| 73 | 72 | } | ... | ... |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmProcessInstanceServiceImpl.java
| ... | ... | @@ -224,6 +224,10 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 224 | 224 | List<ActivityNode> simulateActivityNodes = getSimulateApproveNodeList(startUserId, bpmnModel, |
| 225 | 225 | processDefinitionInfo, |
| 226 | 226 | processVariables, activities); |
| 227 | + // 3.3 如果时发起动作,activityId为开始节点,不校验审批人自选节点 | |
| 228 | + if (ObjUtil.isNotNull(reqVO.getActivityId()) && ObjUtil.equals(reqVO.getActivityId(),BpmnModelConstants.START_USER_NODE_ID)){ | |
| 229 | + simulateActivityNodes.removeIf(node -> BpmTaskCandidateStrategyEnum.APPROVE_USER_SELECT.getStrategy().equals(node.getCandidateStrategy())); | |
| 230 | + } | |
| 227 | 231 | |
| 228 | 232 | // 4. 拼接最终数据 |
| 229 | 233 | return buildApprovalDetail(reqVO, bpmnModel, processDefinition, processDefinitionInfo, historicProcessInstance, | ... | ... |