How to deal with asynchonous transitions
If I am right, using the API the execution of human tasks is synchronous (the call to the executeUserTask return when the execution is finished). But after the execution, the transition is executed by Bonita engine asynchronously. So if just after executing a task you ask for the 'next' human task(s) you will retrieve nothing. But if you retry a few times later (100s milliseconds) you will retrieve the 'next', ready human task.
In my process, when I execute a task I need to retrieve immediately the next human task in order to display the corresponding screen to the user.
My application is a sort of dynamic wizard in which each step depends on the previous step. And each step is defined as a human task. Just to explain, currently, in my design, the human tasks are just separated by a single gateway.
Is there a way to deal with the asynchronous behavior in this 'wizard like' approach ? Just to notice, I cannot simply 'wait' in my task execution code as I will have concurrent access (optimistic locks) on my database updates in connector out and in calls
Thanks in advance
I am not sure that building a 'wizard like' with different tasks having concurrent access is a good idea. Asynchronous execution allows Bonita Engine to handle big volumetries of new case, task & connector executions etc, but it may imply that if there are multiple executions at same time, that the next task of the case take seconds instead of milliseconds, and you will block the user till it is available.
Why do you need to have different human tasks one after other? can you handle in one single human task?