Division of State Machine
The SCXML is divided into the following parts:
-
Order SCXML: Manages events related to Order, OrderLine, Plan, and Order Amendment.
-
Plan Item SCXML: Manages events for individual plan items, with each plan item having its own SCXML stored in the
plan_item_data
table.
The order events are processed in the following sequence:
-
Determines if the event is for the order, order line, plan, amendment, or for a specific plan item.
-
Fetches the required SCXML from the database.
-
Unmarshals the XML to a StateMachine object.
-
Fires the order event.
-
Marshalls the latest snapshot of the StateMachine to XML.
-
Saves this XML back to the database.
By dividing the SCXML into smaller segments, the process of marshaling and unmarshalling becomes more efficient, leading to reduced processing time.