update - 移除无用的 Cmd,并调整 API 模型上校验注解

This commit is contained in:
wangli 2024-03-25 10:12:29 +08:00
parent 17a65ff9c4
commit baa02ad371
5 changed files with 10 additions and 64 deletions

View File

@ -6,8 +6,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
/**
* 抄送
*
@ -23,7 +21,6 @@ public class BpmnCarbonCopyProperty {
* 待办消息模板 ID
*/
@ApiModelProperty(value = "抄送消息模板 ID")
@NotBlank(message = "抄送消息模板 ID 不能为空")
private String carbonCopyMessageId;
/**

View File

@ -1,51 +0,0 @@
package cn.axzo.workflow.core.engine.cmd;
import cn.axzo.workflow.common.model.request.bpmn.task.AttachmentDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.service.ExtAxHiTaskInstService;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.util.CommandContextUtil;
import java.io.Serializable;
import java.util.List;
/**
* 自定义的抄送流程实例的命令实现
*
* @author wangli
* @since 13/03/2024 11:39
*/
public class CustomCarbonCopyProcessInstanceCmd implements Command<Void>, Serializable {
private static final long serialVersionUID = 1L;
private final String processInstanceId;
private final String nodeName;
private final String tenantId;
private final String advice;
private final List<AttachmentDTO> attachmentList;
private final List<BpmnTaskDelegateAssigner> approvers;
private final ExtAxHiTaskInstService extAxHiTaskInstService;
public CustomCarbonCopyProcessInstanceCmd(String processInstanceId, String nodeName, String tenantId, String advice,
List<AttachmentDTO> attachmentList,
List<BpmnTaskDelegateAssigner> approvers,
ExtAxHiTaskInstService extAxHiTaskInstService) {
this.processInstanceId = processInstanceId;
this.nodeName = nodeName;
this.tenantId = tenantId;
this.advice = advice;
this.attachmentList = attachmentList;
this.approvers = approvers;
this.extAxHiTaskInstService = extAxHiTaskInstService;
}
@Override
public Void execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl processEngineConfiguration =
CommandContextUtil.getProcessEngineConfiguration(commandContext);
return null;
}
}

View File

@ -44,7 +44,7 @@ import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.removeDup
* @author wangli
* @since 18/03/2024 11:33
*/
public class CustomCarbonCopyUserTaskAssigneeCmd implements Command<List<BpmnTaskDelegateAssigner>>, Serializable {
public class CustomCarbonCopyUserSelectorCmd implements Command<List<BpmnTaskDelegateAssigner>>, Serializable {
private static final long serialVersionUID = 1L;
private final String processInstanceId;
@ -54,11 +54,11 @@ public class CustomCarbonCopyUserTaskAssigneeCmd implements Command<List<BpmnTas
private final BpmnHistoricTaskInstanceConverter historicTaskInstanceConverter;
private final String serviceVersion;
public CustomCarbonCopyUserTaskAssigneeCmd(String processInstanceId, List<BpmnCarbonCopyConf> carbons,
ServiceTask serviceTask,
EngineExecutionStartListener engineExecutionStartListener,
BpmnHistoricTaskInstanceConverter historicTaskInstanceConverter,
String serviceVersion) {
public CustomCarbonCopyUserSelectorCmd(String processInstanceId, List<BpmnCarbonCopyConf> carbons,
ServiceTask serviceTask,
EngineExecutionStartListener engineExecutionStartListener,
BpmnHistoricTaskInstanceConverter historicTaskInstanceConverter,
String serviceVersion) {
this.processInstanceId = processInstanceId;
this.carbons = carbons;
this.serviceTask = serviceTask;

View File

@ -3,7 +3,7 @@ package cn.axzo.workflow.core.engine.listener;
import cn.axzo.workflow.common.model.request.bpmn.BpmnNoticeConf;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
import cn.axzo.workflow.core.engine.cmd.CustomCarbonCopyUserTaskAssigneeCmd;
import cn.axzo.workflow.core.engine.cmd.CustomCarbonCopyUserSelectorCmd;
import cn.axzo.workflow.core.engine.event.MessagePushEventBuilder;
import cn.axzo.workflow.core.engine.event.MessagePushEventImpl;
import cn.axzo.workflow.core.engine.event.MessagePushEventType;
@ -68,7 +68,7 @@ public class EngineCarbonCopyEventListener implements JavaDelegate {
List<BpmnTaskDelegateAssigner> carbonUsers = new ArrayList<>();
getCarbonCopyConfigs(serviceTask).ifPresent(carbons -> {
carbonUsers.addAll(commandExecutor.execute(new CustomCarbonCopyUserTaskAssigneeCmd(processInstanceId,
carbonUsers.addAll(commandExecutor.execute(new CustomCarbonCopyUserSelectorCmd(processInstanceId,
carbons, serviceTask, engineExecutionStartListener,
historicTaskInstanceConverter, serviceVersion)));
});

View File

@ -23,7 +23,7 @@ import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.common.utils.BpmnCollectionUtils;
import cn.axzo.workflow.core.engine.cmd.CustomAbortProcessInstanceCmd;
import cn.axzo.workflow.core.engine.cmd.CustomCancelProcessInstanceCmd;
import cn.axzo.workflow.core.engine.cmd.CustomCarbonCopyUserTaskAssigneeCmd;
import cn.axzo.workflow.core.engine.cmd.CustomCarbonCopyUserSelectorCmd;
import cn.axzo.workflow.core.engine.cmd.CustomForecastUserTaskAssigneeCmd;
import cn.axzo.workflow.core.engine.listener.EngineExecutionStartListener;
import cn.axzo.workflow.core.service.BpmnProcessDefinitionService;
@ -804,7 +804,7 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
node.setNodeMode(BpmnFlowNodeMode.GENERAL);
getCarbonCopyConfigs(serviceTask).ifPresent(carbons ->
node.setForecastAssigners(springProcessEngineConfiguration.getCommandExecutor()
.execute(new CustomCarbonCopyUserTaskAssigneeCmd(processInstanceId, carbons,
.execute(new CustomCarbonCopyUserSelectorCmd(processInstanceId, carbons,
serviceTask, engineExecutionStartListener,
historicTaskInstanceConverter, serviceVersion))));
}