Node State Transition Diagrams
29 May 2015
These illustrations describe the node state transition semantics of PLEXIL nodes. The previous version of this page is found here; it was written before the addition of Exit Condition, uses a different notation, and does not capture the exact behavior of the Plexil Executive in a few areas.
- 1 INACTIVE state
- 2 WAITING state
- 3 EXECUTING state
- 4 FINISHING state
- 5 FAILING state
- 6 ITERATION_ENDED state
- 7 FINISHED state
Effective with the PLEXIL 3 release, INACTIVE nodes behave as shown:
Nodes in the WAITING state transition directly to FINISHED when their or some ancestor's ExitCondition becomes true.
For Assignment nodes, the assignment takes place when the node transitions to EXECUTING:
EXECUTING - Empty nodes
Empty nodes transition directly to ITERATION_ENDED when their ExitCondition becomes true, or to FINISHED if some ancestor's becomes true.
EXECUTING - Assignment nodes
Assignment nodes transition to FAILING and restore the variable's previous value if their or some ancestor's ExitCondition becomes true, or their or some ancestor's InvariantCondition becomes false. Otherwise Assignment nodes transition to ITERATION_ENDED when the ExitCondition becomes true; the PostCondition determines the outcome.
EXECUTING - Command nodes
Command nodes transition to FINISHING in the nominal case. In the event of an ExitCondition true or InvariantCondition false, they transition to FAILING to abort the command.
Note that the supplied EndCondition is ORed with (command_handle == COMMAND_DENIED || command_handle == COMMAND_FAILED) . This allows the node to transition in the event the resource arbiter rejects the command.
EXECUTING - Update nodes
Update nodes behave similarly to Assignment nodes.
Note that the supplied EndCondition is ANDed with update-complete.
EXECUTING - NodeList and LibraryNodeCall nodes
NodeList and LibraryNodeCall nodes transition to FAILING if their or some ancestor's ExitCondition becomes true.
Note that the default EndCondition for these node types is all children in FINISHED state.
In general, the FINISHING state waits for completion of actions that may take an indeterminate time. If the node fails while waiting for completion, it transitions to FAILING.
FINISHING - Command nodes
FINISHING - NodeList and LibraryNodeCall nodes
In general, FAILING is used to finish recovery from an abnormal situation.
FAILING - Assignment nodes
Assignment nodes simply transition to FINISHED or ITERATION_ENDED as appropriate. The variable has already been restored to its previous value on the transition into FAILING.
Note that the previous as-implemented behavior was to assign UNKNOWN in the event of a failure. The entire team agrees that restoring the previous value is preferable.
FAILING - Command nodes
Command nodes abort the command, wait for the abort to complete, then transition to FINISHED or ITERATION_ENDED as appropriate.
FAILING - Update nodes
Update nodes simply wait for the update to complete, then transition to FINISHED or ITERATION_ENDED as appropriate.
FAILING - NodeList and LibraryNodeCall nodes
NodeList and LibraryNodeCall nodes wait for all children to achieve either the WAITING or FINISHED state before transitioning to FINISHED or ITERATION_ENDED.
ITERATION_ENDED transitions directly to FINISHED if an ancestor's ExitCondition becomes true.
The Finished state is unchanged from the specification and previous implemented behavior.