feat(REQ-4468) - 调整因为提级审批导致节点选人会异常的问题

This commit is contained in:
wangli 2025-07-06 19:45:25 +08:00
parent 9ba4bbc5b9
commit 56be5232bb
2 changed files with 3 additions and 5 deletions

View File

@ -19,7 +19,6 @@ import org.flowable.task.api.history.HistoricTaskInstanceQuery;
import org.flowable.task.service.impl.persistence.entity.TaskEntity; import org.flowable.task.service.impl.persistence.entity.TaskEntity;
import java.io.Serializable; import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -27,6 +26,7 @@ import java.util.Map;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_ADVICE; import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_ADVICE;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_OPERATION_DESC; import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_OPERATION_DESC;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT; import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO;
import static cn.axzo.workflow.common.constant.BpmnConstants.RESET_TASK_ASSIGNER_SHOW_NUMBER; import static cn.axzo.workflow.common.constant.BpmnConstants.RESET_TASK_ASSIGNER_SHOW_NUMBER;
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_ASSIGNEE_SKIP_FLAT; import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_ASSIGNEE_SKIP_FLAT;
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE; import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE;
@ -114,6 +114,8 @@ public class CustomResetTaskApproversCmd extends AbstractCommand<Void> implement
taskEntity.setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + taskEntity.getId(), UPGRADED.getStatus()); taskEntity.setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + taskEntity.getId(), UPGRADED.getStatus());
CustomTaskHelper.deleteMultiTasks(commandContext, tasks); CustomTaskHelper.deleteMultiTasks(commandContext, tasks);
// 移除引擎内部用于确定人的快照变量
runtimeService.removeVariable(taskEntity.getProcessInstanceId(), INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO + taskEntity.getTaskDefinitionKey());
} }
private void resolveOriginTask(CommandContext commandContext, TaskService taskService, TaskEntity task) { private void resolveOriginTask(CommandContext commandContext, TaskService taskService, TaskEntity task) {

View File

@ -28,7 +28,6 @@ import org.springframework.stereotype.Component;
import java.util.Objects; import java.util.Objects;
import static cn.axzo.workflow.common.constant.BpmnConstants.BIZ_NODE_ALTER; import static cn.axzo.workflow.common.constant.BpmnConstants.BIZ_NODE_ALTER;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO;
/** /**
* Core 包内置的活动事件处理,可共用与 Jar 包集成和微服务集成 * Core 包内置的活动事件处理,可共用与 Jar 包集成和微服务集成
@ -112,7 +111,6 @@ public class InternalBpmnActivityEventListener_lo_Listener extends AbstractBpmnE
*/ */
@Override @Override
public void onEnd(DelegateExecution execution) { public void onEnd(DelegateExecution execution) {
log.warn("activity end: processInstanceId : {}, activity: {}", execution.getProcessInstanceId(), execution.getCurrentActivityId());
// ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(); // ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();
// ManagementService managementService = processEngineConfiguration.getManagementService(); // ManagementService managementService = processEngineConfiguration.getManagementService();
// Job timerJob = managementService.createTimerJobQuery() // Job timerJob = managementService.createTimerJobQuery()
@ -122,8 +120,6 @@ public class InternalBpmnActivityEventListener_lo_Listener extends AbstractBpmnE
// if (Objects.nonNull(timerJob)) { // if (Objects.nonNull(timerJob)) {
// CommandContextUtil.getTimerJobService().deleteTimerJob((TimerJobEntity) timerJob); // CommandContextUtil.getTimerJobService().deleteTimerJob((TimerJobEntity) timerJob);
// } // }
execution.removeVariable(INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO + execution.getCurrentActivityId());
log.warn("delete activity list info success...");
TermNodePausingDTO dto = new TermNodePausingDTO(); TermNodePausingDTO dto = new TermNodePausingDTO();
dto.setActivityId(execution.getCurrentActivityId()); dto.setActivityId(execution.getCurrentActivityId());
dto.setProcessInstanceId(execution.getProcessInstanceId()); dto.setProcessInstanceId(execution.getProcessInstanceId());