fix:【bpm】flowable 7.2.0 驳回可使用 moveActivityIdsToSingleActivityId 方法

This commit is contained in:
YunaiV 2025-11-25 08:55:59 +08:00
parent a1a695a033
commit bdb4e3fadc

View File

@ -949,11 +949,13 @@ public class BpmTaskServiceImpl implements BpmTaskService {
Set<String> needSimulateTaskDefinitionKeys = getNeedSimulateTaskDefinitionKeys(bpmnModel, currentTask, targetElement);
// 4. 执行驳回
// 使用 moveExecutionsToSingleActivityId 替换 moveActivityIdsToSingleActivityId 原因
// 当多实例任务回退的时候有问题相关 issue: https://github.com/flowable/flowable-engine/issues/3944
// 使用 moveExecutionsToSingleActivityId 替换 moveActivityIdsToSingleActivityId原因当多实例任务回退的时候有问题
// 相关 issue: https://github.com/flowable/flowable-engine/issues/3944
// flowable 7.2.0 版本后继续使用 moveActivityIdsToSingleActivityId 方法原因flowable 7.2.0 版本修复了该问题
// 相关 issuehttps://github.com/YunaiV/ruoyi-vue-pro/issues/1018
runtimeService.createChangeActivityStateBuilder()
.processInstanceId(currentTask.getProcessInstanceId())
.moveExecutionsToSingleActivityId(runExecutionIds, reqVO.getTargetTaskDefinitionKey())
.moveActivityIdsToSingleActivityId(runExecutionIds, reqVO.getTargetTaskDefinitionKey())
// 设置需要预测的任务 ids 的流程变量用于辅助预测
.processVariable(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_NEED_SIMULATE_TASK_IDS, needSimulateTaskDefinitionKeys)
// 设置流程变量local节点退回标记, 用于退回到节点不执行 BpmUserTaskAssignStartUserHandlerTypeEnum 策略导致自动通过