Creates an instance of the Instance class.
The name of the state machine instance.
The root element of the state machine model that this an instance of.
Optional JSON object used to initialise the active state configuration. The json object must have been produced by a prior call to Instance.toJSON from an instance using the same model.
The name of the state machine instance.
The root element of the state machine model that this an instance of.
Adds a trigger event to the event pool for later evaluation (once the state machine has changed state).
The trigger event to defer.
Build a list of all the deferrable events at a particular state (including its children)
Passes a trigger event to the state machine instance for evaluation.
The trigger event to evaluate.
Returns true if the trigger event was consumed by the state machine (caused a transition or was deferred).
Check for and send deferred events for evaluation
Returns the last known state of a given region. This is the call for application programmers to use as it returns the clean transactional state more efficently.
The region to get the last known state of.
Returns the last known region of the given state. If the state has not been entered this will return undefined.
Returns the last known state of a given region. This is the call for the state machine runtime to use as it returns the dirty transactional state.
The region to get the last known state of.
Returns the last known region of the given state. If the state has not been entered this will return undefined.
Returns the last entered vertex to the state machine runtime.
The region to get the last entered vertex of.
Returns the last entered vertex for the given region.
Reconstruct the active state configuration of a region from a json object.
The region to reconstruct.
The json object holding a serialized version of the active state configuration.
Seriaize the active state configuration of a region to JSON.
The region to serialize.
Returns the JSON representation of the active state configuration of the region.
Updates the transactional state of a region with the last entered state.
The state set as its parents last entered state.
Updates the transactional state of a region with the last entered vertex.
The vertex set as its parents last entered vertex.
Reconstruct the active state configuration of a state from a json object.
The state to reconstruct.
The json object holding a serialized version of the active state configuration.
Serialize the active state configuration of the state machine instance to JSON.
Returns the JSON representation of the active state configuration. This contains just the hierarchy of states and regions with the last known state of each region.
Returns the name of the state machine instance.
The name of the state machine instance.
Performs an operation within a transactional context.
The type of the return parameter of the transactional operation.
The operation to perform within the transactional context.
Returns the return value from the transactional context.
Generated using TypeDoc
Represents the active state configuration of a state machine instance.
This is the default implementation of the IInstance class and reads/writes to the active state configuration in a transactional manner at both initilisation and each call to evaluate.