Browse Source

fix(bpm): 串行多实例审批使用 LinkedHashSet 保证审批人顺序

YunaiV 3 months ago
parent
commit
ba6cdabe62

+ 2 - 1
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmSequentialMultiInstanceBehavior.java

@@ -14,6 +14,7 @@ import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior;
 import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior;
 import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
 
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -53,7 +54,7 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB
             @SuppressWarnings("unchecked")
             Set<Long> assigneeUserIds = (Set<Long>) execution.getVariableLocal(super.collectionVariable, Set.class);
             if (assigneeUserIds == null) {
-                assigneeUserIds = taskCandidateInvoker.calculateUsersByTask(execution);
+                assigneeUserIds = new LinkedHashSet<>(taskCandidateInvoker.calculateUsersByTask(execution));
                 if (CollUtil.isEmpty(assigneeUserIds)) {
                     // 特殊:如果没有处理人的情况下,至少有一个 null 空元素,避免自动通过!
                     // 这样,保证在 BpmUserTaskActivityBehavior 至少创建出一个 Task 任务