REQ-3828 调整代码结构
This commit is contained in:
parent
b2b772a87e
commit
96f9404d30
@ -34,6 +34,7 @@ import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.getLimite
|
||||
*/
|
||||
@Slf4j
|
||||
public class CustomForecastUserTaskAssigneeCmd extends AbstractCommand<List<BpmnTaskDelegateAssigner>> implements Serializable {
|
||||
private static final long serialVersionUID = 2217101915677599319L;
|
||||
private final String processInstanceId;
|
||||
private final UserTask userTask;
|
||||
private final EngineExecutionStartListener engineExecutionStartListener;
|
||||
@ -62,10 +63,8 @@ public class CustomForecastUserTaskAssigneeCmd extends AbstractCommand<List<Bpmn
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<BpmnTaskDelegateAssigner> forecastAssigners = new ArrayList<>();
|
||||
getApproverSpecify(userTask).ifPresent(specify -> {
|
||||
forecastAssigners.addAll(engineExecutionStartListener.approverSelect(specify.getType(), userTask,
|
||||
(DelegateExecution) list.get(0), false));
|
||||
});
|
||||
getApproverSpecify(userTask).ifPresent(specify -> forecastAssigners.addAll(engineExecutionStartListener.approverSelect(specify.getType(), userTask,
|
||||
(DelegateExecution) list.get(0), false)));
|
||||
|
||||
// 如果没找到审批人,加载管理员
|
||||
if (CollectionUtils.isEmpty(forecastAssigners)) {
|
||||
|
||||
@ -93,7 +93,7 @@ public abstract class AbstractBpmnTaskAssigneeSelector implements BpmnTaskAssign
|
||||
ApproverScopeDTO scopeDto = processor.build(flowElement, execution);
|
||||
if (CollectionUtils.isEmpty(scopeDto.getOrgScopes())
|
||||
&& CollectionUtils.isEmpty(scopeDto.getWorkerTeamScopes())) {
|
||||
if (throwException) {
|
||||
if (Boolean.TRUE.equals(throwException)) {
|
||||
throw new WorkflowEngineException(ENGINE_USER_TASK_PARAM_ERROR, flowElement.getId(),
|
||||
processorType.getDesc());
|
||||
}
|
||||
@ -101,7 +101,7 @@ public abstract class AbstractBpmnTaskAssigneeSelector implements BpmnTaskAssign
|
||||
try {
|
||||
return populateNameAndAvatar(invokeService(flowElement, execution, scopeDto), flowSupportApi, refreshProperties, applicationContext);
|
||||
} catch (Throwable t) {
|
||||
if (throwException) {
|
||||
if (Boolean.TRUE.equals(throwException)) {
|
||||
log.warn("执行查询候选审批人时发现异常, 审批节点:{}, 异常信息:{}", flowElement.getId(), t.getMessage());
|
||||
if (!(t instanceof WorkflowEngineException)) {
|
||||
throw new WorkflowEngineException(ENGINE_USER_TASK_CALC_ERROR, flowElement.getId(),
|
||||
|
||||
@ -70,7 +70,7 @@ public class TransferToAdminTaskAssigneeSelector extends AbstractBpmnTaskAssigne
|
||||
protected List<BpmnTaskDelegateAssigner> invokeService(FlowElement flowElement, DelegateExecution execution,
|
||||
ApproverScopeDTO scopeDto) {
|
||||
|
||||
if(supportRefreshProperties.getUseNewToAdminApi()) {
|
||||
if(Boolean.TRUE.equals(supportRefreshProperties.getUseNewToAdminApi())) {
|
||||
return invokeNewQuery(flowElement, execution, scopeDto);
|
||||
} else {
|
||||
return invokeOldQuery(flowElement, execution, scopeDto);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user