Merge branch 'feature/REQ-3383' into 'master'
Feature/req 3383 See merge request universal/infrastructure/backend/workflow-engine!14
This commit is contained in:
commit
15857ee7f3
@ -52,6 +52,14 @@ public class BpmnProcessInstanceAbortDTO {
|
||||
@Length(max = 100, message = "中止原因长度不能超过 100 个字符")
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 评论信息
|
||||
* advice 统一均为审批节点的审批意见,一般为用户在同意、驳回时填写的内容
|
||||
* 有值时,在日志中一般出现在 operationDesc 的下方
|
||||
*/
|
||||
@ApiModelProperty(value = "中止意见")
|
||||
private String advice;
|
||||
|
||||
/**
|
||||
* 附件列表
|
||||
*/
|
||||
|
||||
@ -24,23 +24,12 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_CANCEL_FAIL_NOT_EXISTS;
|
||||
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_CANT_ABORT;
|
||||
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_NOT_EXISTS;
|
||||
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;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_NAME;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_DELETE_REASON;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_ABORT;
|
||||
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.code.BpmnInstanceRespCode.*;
|
||||
import static cn.axzo.workflow.common.constant.BpmnConstants.*;
|
||||
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_ABORT;
|
||||
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.ABORTED;
|
||||
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.CANCELLED;
|
||||
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.batchAddAttachment;
|
||||
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.completeVirtualTask;
|
||||
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.createVirtualTask;
|
||||
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.*;
|
||||
|
||||
/**
|
||||
* 自定义的中止流程实例的命令实现
|
||||
@ -49,14 +38,16 @@ import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.createVir
|
||||
* @since 2024/1/2 18:19
|
||||
*/
|
||||
public class CustomAbortProcessInstanceCmd extends AbstractCommand<Void> implements Serializable {
|
||||
private static final long serialVersionUID = -4141519915611160506L;
|
||||
private final String processInstanceId;
|
||||
private final String tenantId;
|
||||
private final String reason;
|
||||
private final List<AttachmentDTO> attachmentList;
|
||||
private final String nodeName;
|
||||
private BpmnTaskDelegateAssigner assigner;
|
||||
private final BpmnTaskDelegateAssigner assigner;
|
||||
private final String signatureUrl;
|
||||
private final ExtAxHiTaskInstService extAxHiTaskInstService;
|
||||
private final String advice;
|
||||
|
||||
public CustomAbortProcessInstanceCmd(BpmnProcessInstanceAbortDTO dto, ExtAxHiTaskInstService extAxHiTaskInstService) {
|
||||
this.processInstanceId = dto.getProcessInstanceId();
|
||||
@ -68,6 +59,7 @@ public class CustomAbortProcessInstanceCmd extends AbstractCommand<Void> impleme
|
||||
BpmnTaskDelegateAssigner.buildDummyAssigner("system", TASK_ASSIGNEE_SKIP_FLAT, "");
|
||||
this.signatureUrl = dto.getSignatureUrl();
|
||||
this.extAxHiTaskInstService = extAxHiTaskInstService;
|
||||
this.advice = dto.getAdvice();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -121,11 +113,10 @@ public class CustomAbortProcessInstanceCmd extends AbstractCommand<Void> impleme
|
||||
|
||||
// 添加自定义的节点,用于展示最后的操作
|
||||
TaskEntity task = createVirtualTask(commandContext, extAxHiTaskInstService, processInstanceId,
|
||||
nodeName, NODE_ABORT.getType(), null, assigner, ABORTED.getStatus(), new AddComment(reason));
|
||||
nodeName, NODE_ABORT.getType(), advice, assigner, ABORTED.getStatus(), new AddComment(reason));
|
||||
runtimeService.setVariable(task.getProcessInstanceId(), TASK_COMPLETE_OPERATION_TYPE + task.getId(), ABORTED);
|
||||
|
||||
batchAddAttachment(commandContext, task.getProcessInstanceId(), task, attachmentList, assigner);
|
||||
|
||||
completeVirtualTask(commandContext, task);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -195,6 +195,7 @@ public class EngineExecutionStartListener implements ExecutionListener {
|
||||
assigners.addAll(approverSelect(ApproverEmptyHandleTypeEnum.specifyAssignee.getType(), userTask,
|
||||
execution, true));
|
||||
finalEmptyAssigneeHandle(assigners, userTask, execution, "转交指定人员失败,系统自动中止");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user