activiti 获取流程图所有节点

获取流程图所有节点

//流程定义id
String processDefinitionId = runtimeService.createProcessInstanceQuery().processInstanceId(procInstId).singleResult().getProcessDefinitionId();
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId);
Process process = bpmnModel.getProcesses().get(0);
//获取所有节点
Collection flowElements = process.getFlowElements();

只获取任务节点

List UserTaskList = process.findFlowElementsOfType(UserTask.class);

 

你可能感兴趣的:(activiti工作流)