UserTask names

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2012 06:16 AM
Is there a way to list all userTask nodes (the definition: id, name) within a process definition (with activiti service classes).
I am currently using a parser to parse the xml with the process definition.
BR
I am currently using a parser to parse the xml with the process definition.
BR
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2012 03:44 AM
I have a similar problem.
Which parser did you use to parse your file? Did you have written your own parsing process?
Which parser did you use to parse your file? Did you have written your own parsing process?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2012 04:22 AM
just read it as string/bytearray and convert it to a w3c dom… Nothing special
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2012 03:07 AM
You can always use the RepositoryServiceImpl.getDeployedProcessDefinition() and recessively inspect all activities (following sequence flows) in your code, starting from the initial Ativity. Getting out all user-tasks this way is possible.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2012 03:58 AM
The answer:
/* Get the usertasks */
UserTaskActivityBehavior utab = null;
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("process1").latestVersion().singleResult();
ReadOnlyProcessDefinition procDef = ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(processDefinition.getId());
for(PvmActivity activity : procDef.getActivities()) {
if(((ActivityImpl)activity).getActivityBehavior() instanceof UserTaskActivityBehavior) {
utab = (UserTaskActivityBehavior) ((ActivityImpl)activity).getActivityBehavior();
utab.getTaskDefinition().getNameExpression().getExpressionText(); //name
utab.getTaskDefinition().getKey(); //id
}
}
