flowable获取所有节点信息

String processInstanceId = "60308c05-ac56-11e9-81d0-dad8d2a12195";
//获取流程发布Id信息
String definitionId = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult().getProcessDefinitionId();
//获取所有节点信息
List processes = repositoryService.getBpmnModel(definitionId).getProcesses();
System.out.println("processes size:" + processes.size());
List> nextNodes = new ArrayList<>();
for (Process process : processes) {
    Collection flowElements = process.getFlowElements();
    if (CollectionUtils.isNotEmpty(flowElements)) {
        for (FlowElement flowElement : flowElements) {
            if (flowElement instanceof UserTask) {
                System.out.println("UserTask:" + flowElement.getName());
               //业务操作
            }
            if (flowElement instanceof SubProcess) {
               //,,,
            }

        }
    }
}

你可能感兴趣的:(java,flowable)