feat(流程审批): 新增 审批时可动态指定下一级审批人

This commit is contained in:
konbai
2022-11-23 02:30:05 +08:00
parent 704252fa5b
commit 6e6e386a31
4 changed files with 136 additions and 33 deletions

View File

@@ -1,5 +1,6 @@
package com.ruoyi.flowable.utils;
import cn.hutool.core.util.ObjectUtil;
import org.flowable.bpmn.converter.BpmnXMLConverter;
import org.flowable.bpmn.model.Process;
import org.flowable.bpmn.model.*;
@@ -92,6 +93,23 @@ public class ModelUtils {
return null;
}
public static UserTask getUserTaskByKey(BpmnModel model, String taskKey) {
Process process = model.getMainProcess();
FlowElement flowElement = process.getFlowElement(taskKey);
if (flowElement instanceof UserTask) {
return (UserTask) flowElement;
}
return null;
}
public static boolean isMultiInstance(BpmnModel model, String taskKey) {
UserTask userTask = getUserTaskByKey(model, taskKey);
if (ObjectUtil.isNotNull(userTask)) {
return userTask.hasMultiInstanceLoopCharacteristics();
}
return false;
}
/**
* 获取所有用户任务节点
*