-
1. Re: Finding outgoing transitions - jBPM 4
kukeltje Jun 8, 2009 11:11 AM (in response to drbr)1: yes afaik
2: use the taskservice, at least for the 'human' tasks -
2. Re: Finding outgoing transitions - jBPM 4
drbr Jun 9, 2009 2:03 AM (in response to drbr)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.
Any ideas? -
3. Re: Finding outgoing transitions - jBPM 4
drbr Jun 9, 2009 9:04 AM (in response to drbr)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.