JBoss Community

Re: Process Definition MetaData

created by Michael Wohlfart in jBPM - View the full discussion

i guess what you want to do is something like this:

 

public class ProcessDefinitionTaskQueryTest extends JbpmTestCase {
 
  public void testQueryProcessDefinitionTasks() {
    deployJpdlXmlString(
      "<process name='findMyTasks'>" +
      "  <start name='start' />" +
      "  <task name='do something' >" +
      "  </task>" +
      "  <task name='do something else' >" +
      "  </task>" +
      "</process>"
    );
 
 
    ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositoryService.createProcessDefinitionQuery()
      .processDefinitionKey(QueryOperator.EQUALS, "findMyTasks")
      .uniqueResult();
 
    Map<String, ?> activities = processDefinition.getActivitiesMap();
 
    Set<Entry<String, ?>> entries = (Set)activities.entrySet();
    for (Entry entry : entries) {
      System.err.println(entry.getKey() + " -> " + entry.getValue());
    }
    
  }
 
}

 

this gives you the task nodes and the start node:

 

do something -> activity(do something)
do something else -> activity(do something else)
start -> activity(start)

Reply to this message by going to Community

Start a new discussion in jBPM at Community