mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
【功能新增】工作流:BpmTaskCandidateAssignEmptyStrategy 读取流程管理员
This commit is contained in:
parent
742c2967de
commit
ad0d9d10c8
@ -1,11 +1,16 @@
|
||||
package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmUserTaskAssignEmptyHandlerTypeEnum;
|
||||
import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateStrategy;
|
||||
import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmTaskCandidateStrategyEnum;
|
||||
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils;
|
||||
import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashSet;
|
||||
@ -20,6 +25,10 @@ import java.util.Set;
|
||||
@Component
|
||||
public class BpmTaskCandidateAssignEmptyStrategy extends BpmTaskCandidateAbstractStrategy {
|
||||
|
||||
@Resource
|
||||
@Lazy // 延迟加载,避免循环依赖
|
||||
private BpmProcessDefinitionService processDefinitionService;
|
||||
|
||||
public BpmTaskCandidateAssignEmptyStrategy(AdminUserApi adminUserApi) {
|
||||
super(adminUserApi);
|
||||
}
|
||||
@ -45,8 +54,9 @@ public class BpmTaskCandidateAssignEmptyStrategy extends BpmTaskCandidateAbstrac
|
||||
|
||||
// 情况二:流程管理员
|
||||
if (Objects.equals(assignEmptyHandlerType, BpmUserTaskAssignEmptyHandlerTypeEnum.ASSIGN_ADMIN.getType())) {
|
||||
// TODO 芋艿:需要等待流程实例的管理员支持
|
||||
throw new UnsupportedOperationException("暂时实现!!!");
|
||||
BpmProcessDefinitionInfoDO processDefinition = processDefinitionService.getProcessDefinitionInfo(execution.getProcessDefinitionId());
|
||||
Assert.notNull(processDefinition, "流程定义({})不存在", execution.getProcessDefinitionId());
|
||||
return new HashSet<>(processDefinition.getManagerUserIds());
|
||||
}
|
||||
|
||||
// 都不满足,还是返回空
|
||||
|
Loading…
Reference in New Issue
Block a user