Node State Transition Diagrams

From plexil
Jump to: navigation, search

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.

INACTIVE state

Effective with the PLEXIL 3 release, INACTIVE nodes behave as shown:

Inactive state for all node types

WAITING state

Nodes in the WAITING state transition directly to FINISHED when their or some ancestor's ExitCondition becomes true.

Waiting state for most node types

For Assignment nodes, the assignment takes place when the node transitions to EXECUTING:

Waiting state for Assignment nodes

EXECUTING state

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 Empty nodes with Exit condition.png

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 Assignment nodes with Exit condition.png

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 Command with Exit and FINISHING.png

EXECUTING - Update nodes

Update nodes behave similarly to Assignment nodes.

Note that the supplied EndCondition is ANDed with update-complete.

Executing Update with Exit condition.png

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.

Executing List nodes with Exit condition.png

FINISHING 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 Command with Exit condition.png

FINISHING - NodeList and LibraryNodeCall nodes

Finishing with Exit condition.png

FAILING state

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 Assignment nodes with Exit condtion.png

FAILING - Command nodes

Command nodes abort the command, wait for the abort to complete, then transition to FINISHED or ITERATION_ENDED as appropriate.

Failing Command with Exit condition.png

FAILING - Update nodes

Update nodes simply wait for the update to complete, then transition to FINISHED or ITERATION_ENDED as appropriate.

Failing Update with Exit condition.png

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.

Failing List node with Exit condition.png

ITERATION_ENDED state

ITERATION_ENDED transitions directly to FINISHED if an ancestor's ExitCondition becomes true.

Iteration Ended with Exit condition.png

FINISHED state

The Finished state is unchanged from the specification and previous implemented behavior.

Finished Revised.png