Next possible task

Hi all,

How do I know what the next possible task for a case is? 

Hello,

You can't do that (or let's say, it's very complicated)

When you are on a task "Prepare Coffee", you can have a look on the process, then see the next task is "Warm Coffee Machine", so you can say "I can determine the next task".

Via the Java Bonita API, you can access to the Process Design. Then look the transition to go out "Prepare Coffee" and find the next tasks.

Visit in ProcessAPI

DesignProcessDefinition getDesignProcessDefinition(long processDefinitionId)

In DesignProcessDefinition, access 

FlowElementContainerDefinition getFlowElementContainer()

and you have transitions, tasks....

 

 
But what about a more complex process?

let's imagine you have a connector Out in "prepare coffee", and this connector calculate the coffee to use (depends on the stock, the day, special offer)

Then, you have a decision gateway, to go to "Warm Coffee Machine", or to the task "Go To Starbuck (or Peet's coffee, depends what you prefer)", or just goes directly to the task "Enjoy your coffee".

Imagine then you have a Timer Boundary Event, if you wait more than 2 hours in the task" Prepare coffee", which send the case to the task "aborting". 

How do you calculate then the next task? You have to execute first the connector, then the gateway to known the next tasks.

So, my question is "what is your need?" Why do you need to know the next task?