jbpm4.4根据流程定义获取所有的流程节点Activity

jbpm4.4根据流程定义获取所有的流程节点Activity

 

ProcessInstance pi = executionService.findProcessInstanceById("leave.-1700445529");

definitionId = getProcessDefinitionId();

 

RepositoryService repositoryService = processEngine.getRepositoryService();

ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().processDefinitionId(definitionId).uniqueResult();

ProcessDefinitionImpl definitionimpl = (ProcessDefinitionImpl)definition;

List<? extends Activity> list = definitionimpl.getActivities();

for (Activity activity : list) {

System.out.println(activity.getName());

}

关键是:把ProcessDefinition 强行转换为其实现类:ProcessDefinitionImpl ,然后调用getActivities()方法即可获取。

你可能感兴趣的:(jbpm,jbpm)