update - 完善每个节点的 operationDesc

This commit is contained in:
wangli 2024-01-05 15:34:08 +08:00
parent ff16ce6a28
commit 8dcd0c786e
3 changed files with 9 additions and 3 deletions

View File

@ -17,6 +17,7 @@ import java.util.List;
import java.util.Objects;
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.INTERNAL_SPECIFY_NEXT_APPROVER;
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.APPROVED;
@ -57,7 +58,7 @@ public class CustomApproveTaskCmd implements Command<Void>, Serializable {
validTask((TaskEntity) task, approver);
addComment(commandContext, task, COMMENT_TYPE_ADVICE, advice);
addComment(commandContext, task, COMMENT_TYPE_OPERATION_DESC, approver.getAssignerName() + "已通过");
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
if (Objects.nonNull(nextApprover)) {
// 主动设置下级审批人

View File

@ -18,6 +18,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_OPERATION_DESC;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_DELETE_PROCESS_FLAG;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_TENANT_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_ID;
@ -25,6 +26,7 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_N
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_REJECT;
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.REJECTED;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.addComment;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.batchAddAttachment;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.createVirtualTask;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.validTask;
@ -61,11 +63,10 @@ public class CustomRejectionTaskCmd implements Command<Void>, Serializable {
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
validTask((TaskEntity) task, approver);
addComment(commandContext, task, COMMENT_TYPE_OPERATION_DESC, approver.getAssignerName() + "已驳回");
((TaskEntity) task).setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + task.getId(), REJECTED.getStatus());
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
// runtimeService.setVariable(task.getProcessInstanceId(), TASK_COMPLETE_OPERATION_TYPE + task.getId()
// , REJECTED);
createVirtualTask(commandContext, extAxHiTaskInstService, task.getProcessInstanceId(), task.getName(),
task.getTaskDefinitionKey(), advice, approver, REJECTED.getStatus());

View File

@ -16,6 +16,7 @@ import org.springframework.stereotype.Component;
import java.util.Objects;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_OPERATION_DESC;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_INITIATOR;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO;
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE;
@ -58,6 +59,9 @@ public class StartNodeAutoCompleteEventListener implements BpmnTaskEventListener
initiator);
delegateTask.setTransientVariable(TASK_COMPLETE_OPERATION_TYPE + delegateTask.getId(),
APPROVED.getStatus());
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(),
COMMENT_TYPE_OPERATION_DESC,
initiator.getAssignerName());
// 直接完成
taskService.complete(delegateTask.getId(), runtimeService.getVariables(delegateTask.getExecutionId()));
}