Commit ceb804667945df86195835570c6bf37f7e2f9b28

Authored by 芋道源码
Committed by Gitee
2 parents a2ff100c aee514cf

!1466 更改 moveActivityIdsToSingleActivityId 传入的第一个参数

Merge pull request !1466 from zz/dev_zz
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java
... ... @@ -922,16 +922,16 @@ public class BpmTaskServiceImpl implements BpmTaskService {
922 922 List<UserTask> returnUserTaskList = BpmnModelUtils.iteratorFindChildUserTasks(targetElement, runTaskKeyList, null, null);
923 923 List<String> returnTaskKeyList = convertList(returnUserTaskList, UserTask::getId);
924 924  
925   - List<String> runExecutionIds = new ArrayList<>();
  925 +// List<String> runExecutionIds = new ArrayList<>();
926 926 // 2. 给当前要被退回的 task 数组,设置退回意见
927 927 taskList.forEach(task -> {
928 928 // 需要排除掉,不需要设置退回意见的任务
929 929 if (!returnTaskKeyList.contains(task.getTaskDefinitionKey())) {
930 930 return;
931 931 }
932   - if (task.getExecutionId() != null) {
933   - runExecutionIds.add(task.getExecutionId());
934   - }
  932 +// if (task.getExecutionId() != null) {
  933 +// runExecutionIds.add(task.getExecutionId());
  934 +// }
935 935  
936 936 // 判断是否分配给自己任务,因为会签任务,一个节点会有多个任务
937 937 if (isAssignUserTask(userId, task)) { // 情况一:自己的任务,进行 RETURN 标记
... ... @@ -953,9 +953,12 @@ public class BpmTaskServiceImpl implements BpmTaskService {
953 953 // 相关 issue: https://github.com/flowable/flowable-engine/issues/3944
954 954 // ② flowable 7.2.0 版本后,继续使用 moveActivityIdsToSingleActivityId 方法。原因:flowable 7.2.0 版本修复了该问题。
955 955 // 相关 issue:https://github.com/YunaiV/ruoyi-vue-pro/issues/1018
  956 + // ③ moveExecutionsToSingleActivityId 基于运行时执行实例层面的精确控制,它的操作对象(第一个参数)是 executionId,需要收集到 runExecutionIds
  957 + // moveActivityIdsToSingleActivityId 基于 BPMN 模型层面的节点迁移,它的操作对象(第一个参数)是 taskKey
956 958 runtimeService.createChangeActivityStateBuilder()
957 959 .processInstanceId(currentTask.getProcessInstanceId())
958   - .moveActivityIdsToSingleActivityId(runExecutionIds, reqVO.getTargetTaskDefinitionKey())
  960 +// .moveExecutionsToSingleActivityId(runExecutionIds, reqVO.getTargetTaskDefinitionKey())
  961 + .moveActivityIdsToSingleActivityId(returnTaskKeyList, reqVO.getTargetTaskDefinitionKey())
959 962 // 设置需要预测的任务 ids 的流程变量,用于辅助预测
960 963 .processVariable(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_NEED_SIMULATE_TASK_IDS, needSimulateTaskDefinitionKeys)
961 964 // 设置流程变量(local)节点退回标记, 用于退回到节点,不执行 BpmUserTaskAssignStartUserHandlerTypeEnum 策略,导致自动通过
... ...