Analysis Transaction Boundaries

The next transaction boundary is with regard to analysis processing. In analysis, the business process actually gets (analyzes) the event and processes. The analysis takes place within another transaction boundary.

The process enters the transaction in its current state and exits in a new state, based on the event analysis. Before the transaction is closed the process state is updated on the database. The route for the event and this particular process is also updated to show that the event was analyzed.

If the event was routed to more than one process, there will be one route record for each process that will analyze the event. Depending on the processes, they could finish at different times. The route records are updated independently, by process. Depending on the processes, one could show the event as analyzed, while another one is still working with it.

Note: At any given time, an analysis thread only works with one process. It may have others assigned to it, but it only works with one at a time. This means the commits are done per process. Not only would the route records for an event sent to multiple processes get updated at different times, they will be updated within different transactions.

Once the commit is issued to the database and the transaction is closed, the process has been saved in its new, now current, state and the route record is complete. If the engine goes down during analysis there will be no new process state and the route record will not show the event as analyzed. It will be as if the process had never seen the event. When the engine comes back up, all processes that were not in a completed, or failed state are retrieved from the database and recreated in the engine. They will be in the state they were in before the analysis started. The engine then retrieves all the route records for the reconstituted processes that have not been marked as analyzed. If one process had finished with the event, but another one has not, only the route record for the unfinished process will be retrieved. The events in each of these route records are also reconstituted from the database, and given back to the processes. In turn, the processes start analyzing the events again. No data is lost and no processing is duplicated as long as your state database maintains its integrity.