| | |
| | | * |
| | | * @param processDefinitionId 流程定义id |
| | | */ |
| | | public Map<String, List<ExtensionElement>> getExtensionElements(String processDefinitionId) { |
| | | public static Map<String, List<ExtensionElement>> getExtensionElements(String processDefinitionId) { |
| | | Map<String, List<ExtensionElement>> map = new HashMap<>(); |
| | | List<FlowElement> flowElements = getFlowElements(processDefinitionId); |
| | | for (FlowElement flowElement : flowElements) { |
| | |
| | | * @param processDefinitionId 流程定义id |
| | | * @param flowElementId 节点id |
| | | */ |
| | | public Map<String, List<ExtensionElement>> getExtensionElement(String processDefinitionId, String flowElementId) { |
| | | public static Map<String, List<ExtensionElement>> getExtensionElement(String processDefinitionId, String flowElementId) { |
| | | BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(processDefinitionId); |
| | | Process process = bpmnModel.getMainProcess(); |
| | | FlowElement flowElement = process.getFlowElement(flowElementId); |
| | | return flowElement.getExtensionElements(); |
| | | } |
| | | |
| | | /** |
| | | * 判断当前节点是否为用户任务 |
| | | * |
| | | * @param processDefinitionId 流程定义id |
| | | * @param taskDefinitionKey 流程定义id |
| | | */ |
| | | public static boolean isUserTask(String processDefinitionId, String taskDefinitionKey) { |
| | | BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(processDefinitionId); |
| | | FlowNode flowNode = (FlowNode) bpmnModel.getFlowElement(taskDefinitionKey); |
| | | return flowNode instanceof UserTask; |
| | | } |
| | | } |