Commit f6f46ada6c4f9c9007ea2a3128f5ab6da50e628d
1 parent
fa359d22
【缺陷修复】 修复多实例任务时,审批人为空时,导致报错问题
Showing
2 changed files
with
2 additions
and
2 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmParallelMultiInstanceBehavior.java
| ... | ... | @@ -54,13 +54,13 @@ public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehav |
| 54 | 54 | Set<Long> assigneeUserIds = (Set<Long>) execution.getVariable(super.collectionVariable, Set.class); |
| 55 | 55 | if (assigneeUserIds == null) { |
| 56 | 56 | assigneeUserIds = taskCandidateInvoker.calculateUsersByTask(execution); |
| 57 | - execution.setVariable(super.collectionVariable, assigneeUserIds); | |
| 58 | 57 | if (CollUtil.isEmpty(assigneeUserIds)) { |
| 59 | 58 | // 特殊:如果没有处理人的情况下,至少有一个 null 空元素,避免自动通过! |
| 60 | 59 | // 这样,保证在 BpmUserTaskActivityBehavior 至少创建出一个 Task 任务 |
| 61 | 60 | // 用途:1)审批人为空时;2)审批类型为自动通过、自动拒绝时 |
| 62 | 61 | assigneeUserIds = SetUtils.asSet((Long) null); |
| 63 | 62 | } |
| 63 | + execution.setVariable(super.collectionVariable, assigneeUserIds); | |
| 64 | 64 | } |
| 65 | 65 | return assigneeUserIds.size(); |
| 66 | 66 | } | ... | ... |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmSequentialMultiInstanceBehavior.java
| ... | ... | @@ -47,13 +47,13 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB |
| 47 | 47 | Set<Long> assigneeUserIds = (Set<Long>) execution.getVariable(super.collectionVariable, Set.class); |
| 48 | 48 | if (assigneeUserIds == null) { |
| 49 | 49 | assigneeUserIds = taskCandidateInvoker.calculateUsersByTask(execution); |
| 50 | - execution.setVariable(super.collectionVariable, assigneeUserIds); | |
| 51 | 50 | if (CollUtil.isEmpty(assigneeUserIds)) { |
| 52 | 51 | // 特殊:如果没有处理人的情况下,至少有一个 null 空元素,避免自动通过! |
| 53 | 52 | // 这样,保证在 BpmUserTaskActivityBehavior 至少创建出一个 Task 任务 |
| 54 | 53 | // 用途:1)审批人为空时;2)审批类型为自动通过、自动拒绝时 |
| 55 | 54 | assigneeUserIds = SetUtils.asSet((Long) null); |
| 56 | 55 | } |
| 56 | + execution.setVariable(super.collectionVariable, assigneeUserIds); | |
| 57 | 57 | } |
| 58 | 58 | return assigneeUserIds.size(); |
| 59 | 59 | } | ... | ... |