Get next task name

1
+2
-1

Hi, I wanna know how to get the next task(s) name ?

2 answers

1
+1
-1

Hi

In the processAPI, you will find a getDesignProcessDefinition method

from this DesignProcessDefinition class, call getProcessContainer() method returning a FlowElementContainerDefinition

from the latest, call getTransitions(), iterate through this Set and check your current position (current task) to the one returned by the getSource() method. Once you have found Transition, get the Destination

then depending on the complexity of your process you should be able to find your way to the next gateway and then to the next tasks available...

keep me informed! cheers, RP

1
0
-1

Can you be more precise ? What is your use case ?

Are they next human task ? Are they any activity, whatever their kind ? Are they from the current process, or from any process ? For the same user or for any user ?

Surely you will end up with a list. You will have to go through the process definition to determine what are the available choice.

Getting the next task name means that you need to check all the different alternative from the current task. You may have a set of gateways to go through. First get the current task instance. Retrieve the corresponding task definition. Check on the process definition what are the output from this task definition. Follow the list of possible outputs... etc...

Comments

Submitted by othmane791 on Fri, 07/04/2014 - 16:42

in fact I wanna get the next human tasks for an Actor. I mean the different human tasks that I could do after a gateway.

Submitted by renaud.pichot on Mon, 07/07/2014 - 15:23

a task being finished, you want to display for the current user the list of available tasks ?

Submitted by othmane791 on Mon, 07/07/2014 - 18:33

No, I want to show to the actual user before his task being finished, the possible next tasks after a gateway.

Submitted by Sean McP on Wed, 08/20/2014 - 17:04

The way I did this was to build a database of next tasks, and used that...easier and much less complex than connectors and Java running through...as RP says...

> getProcessContainer() method returning a FlowElementContainerDefinition from the latest, call getTransitions(), iterate through this Set and check your current position (current task) to the one returned by the getSource() method. Once you have found Transition, get the Destination then depending on the complexity of your process you should be able to find your way to the next gateway and then to the next tasks available...

Notifications