获取流程图所有节点
//流程定义id
String processDefinitionId = runtimeService.createProcessInstanceQuery().processInstanceId(procInstId).singleResult().getProcessDefinitionId();
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId);
Process process = bpmnModel.getProcesses().get(0);
//获取所有节点
Collection<FlowElement> flowElements = process.getFlowElements();
只获取任务节点
List<UserTask> UserTaskList = process.findFlowElementsOfType(UserTask.class);