update - 审批人去重后, 调整审批日志处理逻辑

This commit is contained in:
wangli 2024-01-10 14:10:46 +08:00
parent 8387b00a3b
commit 4a1d321174
2 changed files with 6 additions and 7 deletions

View File

@ -1,6 +1,5 @@
package cn.axzo.workflow.core.engine.cmd;
import cn.axzo.workflow.common.constant.BpmnConstants;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper;
@ -18,9 +17,9 @@ import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import static cn.axzo.workflow.common.constant.BpmnConstants.DUMMY_ASSIGNEE_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.HIDDEN_ASSIGNEE_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.NO_ASSIGNEE;
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.DELETED;
import static cn.axzo.workflow.core.common.code.BpmnTaskRespCode.ACTIVITY_BIZ_SET_ASSIGNEE_ERROR;
@ -49,7 +48,7 @@ public class CustomBizSpecifyAssigneeToTaskCmd implements Command<Boolean>, Seri
TaskService taskService = processEngineConfiguration.getTaskService();
Task task = taskService.createTaskQuery().executionId(executionId)
.taskAssignee(DUMMY_ASSIGNEE_ID)
.taskAssignee(NO_ASSIGNEE)
.singleResult();
validTask(task);
@ -70,7 +69,7 @@ public class CustomBizSpecifyAssigneeToTaskCmd implements Command<Boolean>, Seri
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + task.getTaskDefinitionKey(), List.class);
for (BpmnTaskDelegateAssigner assigner : originAssingeeList) {
if (Objects.equals(assigner.buildAssigneeId(), DUMMY_ASSIGNEE_ID)) {
if (Objects.equals(assigner.buildAssigneeId(), NO_ASSIGNEE)) {
originAssingeeList.remove(assigner);
break;
}
@ -99,7 +98,7 @@ public class CustomBizSpecifyAssigneeToTaskCmd implements Command<Boolean>, Seri
if (Objects.isNull(task)) {
throw new WorkflowEngineException(ACTIVITY_BIZ_SET_ASSIGNEE_ERROR, executionId);
}
if (!Objects.equals(task.getAssignee(), BpmnConstants.DUMMY_ASSIGNEE_ID)) {
if (!Objects.equals(task.getAssignee(), NO_ASSIGNEE)) {
throw new WorkflowEngineException(ACTIVITY_CANT_SET_ASSIGNEE);
}
}

View File

@ -27,8 +27,8 @@ import java.util.List;
import java.util.Objects;
import java.util.Optional;
import static cn.axzo.workflow.common.constant.BpmnConstants.DUMMY_ASSIGNEE_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.NO_ASSIGNEE;
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_ASSIGNEE_SKIP_FLAT;
/**
@ -61,7 +61,7 @@ public class MessagePushTaskEventListener implements BpmnTaskEventListener, Orde
pendingComplete(delegateTask);
return;
}
if (Objects.equals(DUMMY_ASSIGNEE_ID, delegateTask.getAssignee())) {
if (Objects.equals(NO_ASSIGNEE, delegateTask.getAssignee())) {
// 业务指定审批人, 不用发待办
return;
}