Thanks, Peter
thanks for the reply. I'm not sure whether I got it 100%. So, is it the transaction of the boundary event that does the interrupt of the subprocess? If that is so, I could start the first task after the boundary event with a new transaction. That would guarantee that the subprocess is dead and cleaned up before I perform any business logic in the main process. Is this correct?
Greetings, Peter
Hi Peter,
So, is it the transaction of the boundary event that does the interrupt of the subprocess?
Yes, indeed. The process engine is a simple state machine: when the boundary event is triggered, a new transaction will be started. This transaction checks out the state of the process instance from the database, deletes the execution for the subprocess and tries to commit. If in the meantime (after the state was loaded from the database and before the delete was committed) another transaction changed the state in the database, an optimistic locking exception will occur and the transaction will roll back.
I could start the first task after the boundary event with a new transaction. That would guarantee that the subprocess is dead and cleaned up before I perform any business logic in the main process. Is this correct?
Yes.
Cheers,
Daniel Meyer