update(REQ-2324) - 业务节点如果设置的是“业务指定审批人”,且业务传入了空审批人,则服务端主动驳回该实例
This commit is contained in:
parent
098b09c3b9
commit
48d4025f02
@ -6,7 +6,6 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -42,11 +41,12 @@ public class BpmnActivitySetAssigneeDTO {
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 需要设置的审批人, 业务侧自行去重, 请根据 personId 进行去重, 如果发现有重复, 并抛出异常
|
||||
* 需要设置的审批人, 业务侧自行去重, 请根据 personId 进行去重, 如果发现有重复, 并抛出异常.
|
||||
* <p>
|
||||
* 业务如果传入的 assigners 集合为空, 引擎则会对该流程进行自动驳回处理,且驳回意见为“业务未指定审批人”
|
||||
*/
|
||||
@ApiModelProperty(value = "审批人集合信息", notes = "业务传参时,需要注意去重")
|
||||
@Valid
|
||||
@NotEmpty(message = "审批人不能为空")
|
||||
private List<BpmnTaskDelegateAssigner> assigners;
|
||||
|
||||
/**
|
||||
|
||||
@ -2,14 +2,17 @@ package cn.axzo.workflow.core.service.impl;
|
||||
|
||||
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnActivitySetAssigneeDTO;
|
||||
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
|
||||
import cn.axzo.workflow.core.engine.cmd.CustomAbortProcessInstanceCmd;
|
||||
import cn.axzo.workflow.core.engine.cmd.CustomBizSpecifyAssigneeToTaskCmd;
|
||||
import cn.axzo.workflow.core.service.BpmnProcessActivityService;
|
||||
import cn.axzo.workflow.core.service.ExtAxHiTaskInstService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.common.engine.impl.interceptor.CommandExecutor;
|
||||
import org.flowable.engine.RuntimeService;
|
||||
import org.flowable.engine.runtime.Execution;
|
||||
import org.flowable.spring.SpringProcessEngineConfiguration;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
@ -24,6 +27,8 @@ public class BpmnProcessActivityServiceImpl implements BpmnProcessActivityServic
|
||||
@Resource
|
||||
private RuntimeService runtimeService;
|
||||
@Resource
|
||||
private ExtAxHiTaskInstService extAxHiTaskInstService;
|
||||
@Resource
|
||||
private SpringProcessEngineConfiguration processEngineConfiguration;
|
||||
|
||||
@Override
|
||||
@ -38,6 +43,10 @@ public class BpmnProcessActivityServiceImpl implements BpmnProcessActivityServic
|
||||
@Override
|
||||
public void setAssignee(BpmnActivitySetAssigneeDTO dto) {
|
||||
CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
|
||||
if (CollectionUtils.isEmpty(dto.getAssigners())) {
|
||||
Execution execution = runtimeService.createExecutionQuery().executionId(dto.getTriggerId()).singleResult();
|
||||
commandExecutor.execute(new CustomAbortProcessInstanceCmd(execution.getProcessInstanceId(), null, "业务未指定审批人", extAxHiTaskInstService));
|
||||
}
|
||||
commandExecutor.execute(new CustomBizSpecifyAssigneeToTaskCmd(dto.getTriggerId(), dto.getAssigners()));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user