This content has been marked as final.
Show 4 replies
-
1. Re: Process Definition MetaData
rebody Sep 17, 2010 8:34 AM (in response to kareemergawy)Hi Kareem,
Do you mean that you want a way to query process definition? I suggest you to have a try ProcessDefinitionQuery.
-
2. Re: Process Definition MetaData
kareemergawy Sep 20, 2010 2:38 AM (in response to rebody)Thanks for your reply. I know about ProcessDefinitionQuery. But the problem is that ProcessDefinition object doesn't contain any methods to get the nodes (tasks) in the process definition. That's what I need to know.
-
3. Re: Process Definition MetaData
mwohlf Sep 20, 2010 8:55 AM (in response to kareemergawy)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) -
4. Re: Process Definition MetaData
kareemergawy Sep 28, 2010 11:01 AM (in response to mwohlf)Thanks a lot Michael your solution solved my problem