The state of a process is not saved until there is nothing left to do, and the JbpmContext is closed. This typically happens under 3 conditions:
- encountering a node marked "async"
- completion of the process
- the process is completely blocked, waiting for external stimuli to resume. These may be user actions, timers, JMS messages, or whatever.
If you want the state committed more frequently than it is, the easiest way is to mark nodes "async". This flushes all process data to the database and then reloads before the node's action is performed.
Thanks Ed for your reply.
We have tried to mark as "async" the nodes of the process, but then the process itself did not execute the action associated to the node.
We didn't make any modification to the jBPM configuration for the async execution.
Perhaps we need to do something in that direction?
We found the solution.
At the start of our main() now we call JbpmConfiguration.getInstance().startJobExecutor().
We've missed this method.... :-)