cancel
Showing results for 
Search instead for 
Did you mean: 

get all task definition of a process definition

ameetpatel
Champ in-the-making
Champ in-the-making
Hi All,

Is there any way I can get all tasks definition of the the process event if that are not instantiated yet?

Thanks,
Ameet
3 REPLIES 3

lpavone
Champ in-the-making
Champ in-the-making
Hi,

I had the same problem today and I haven't found a way to resolve it.
I think that the only way to get it is getting and parsing the XML process file but I'm not sure.
I can't get task definition using the API.

dognose
Champ in-the-making
Champ in-the-making

lpavone
Champ in-the-making
Champ in-the-making
thanks dognose!

If someone need the code to get the taskDefinitions from the process definition, the snippet below works fine:
(the only one difference from dognose code, is using PvmActivity instead of ActivityImpl)

ReadOnlyProcessDefinition processDefinition =
   ((RepositoryServiceImpl)repositoryService)
   .getDeployedProcessDefinition( procDef );

if (processDefinition != null) {
       for (PvmActivity activity : processDefinition.getActivities()) {
         String type = (String) activity.getProperty("type");
         System.out.println( type + ":  " + activity.getProperty("name"));
         // …
       }


type could be userTask, exclusiveGateway, endEvent and so on… and name will be the name of the element in the bpm diagram..