1: yes afaik
2: use the taskservice, at least for the 'human' tasks
Thanks kukeltje, however I believe that the TaskService can only give me the list of pending tasks that have previously been assigned to a particular user, correct?
What I'm interested to find out is the list of the available outgoing transition of the currently active (or any...) activity of my workflow. I have the same requirement as other people have had in the past on this forum, i.e. to enable/disable menus & buttons according to what actions (outgoing transitions) the user is allowed to perform. I've seen previous posts on the forum regarding exactly that, however they're for v.3 and don't seem to be working on v.4.
Ok, I found a solution, here it is if anybody is interested:
Configuration configuration = new Configuration(); ProcessEngine processEngine = configuration.buildProcessEngine(); Environment env = ((EnvironmentFactory)processEngine).openEnvironment(); RepositorySession repositorySession = env.getFromCurrent(RepositorySession.class); ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.findProcessDefinitionById("_YOUR_ID_"); Activity a = processDefinition.findActivity("_ACTIVITY_NAME_");
Once you have the Activity object, you can query it for a lot of information including the list of outgoing transitions.