Sage Modeling and Simulation Library

StateMachine Class

A table-driven, two-phase-transaction state machine. The user configures the state machine with a number of states, and the state machine creates handlers for transition out of and into each state, as well as handlers for transitions between two specific states, and one universal transition handler. Each handler provides events that are fired when the state machine attempts and then either completes or rolls back a transition. When a transition is requested, the state machine collects all of the outbound transition handlers from the current state, all of the handlers into the destination state, all handlers specified for both the current and destination states, and the universal handler. These handlers' 'Prepare' events are called in the order implied by their sequence numbers (if no sequence number was specified, it is assumed to be 0.0.) If all 'Prepare' handlers' event targets are called with none returning a TransitionFailureReason, then the State Machine calls all of the Commit events. If there was at least one TransitionFailureReason, then the 'Rollback' event handlers are called.

Namespace:  Highpoint.Sage.SimCore
Assembly:  Sage4 (in Sage4.dll)

Syntax


public class StateMachine

Inheritance Hierarchy


Object
  Highpoint.Sage.SimCore..::..StateMachine