State Machine Diagram in Cradle
There are three kinds of behavior diagrams: Activity, Sequence-Interaction, and State Machine diagrams. State Machine diagrams describe how a block transitions from one state to another and defines what logical behavior (activities, sequence-interactions, or state machines owned by the block) are performed when entering or exiting a State.
This type of diagram is great for describing an integrated view of a block’s behavior because all the individual threads of behavior, defined for a block are integrated into a single integrated model using the stm diagram.
As the user integrates the use of these other elements together he/she can see whether or not they function together as desired.
The rounded corner rectangles represent a block’s states. Associated with a state are various behaviors that are performed whenever the state is entered (‘entry/behavior’) or exited (‘exit/behavior’). In addition, the state may perform a behavior that executes once the entry behavior has completed and continues to execute until it completes or the state is exited (i.e., a ‘do/behavior’). In the above example the ‘Vehicle Off’ State has a behaviors compartment that shows an entry behavior named ‘Check Vehicle Status’. The entry/, exit/ and do/ behaviors are cross reference linked to the State element. In other words the information displayed in the behaviors compartment is not plain text typed into a field in the symbol, the display is constructed from live elements linked to the State.
A transition from one state to another is represented by an arrow symbol. The transition can be controlled by a ‘trigger event’ and/or a ‘guard expression’. The ‘trigger event’ can be a ‘signal event’, a ‘call event’, a ‘change event’, or a ‘time event’. See the State Machine Diagram Symbol Definition PDF for a description of these events. In the above example, see the transition symbol leaving the ‘Vehicle On’ state and entering the ‘Vehicle Off’ state. It has an ‘Ignition On’ signal trigger event, and it has a specified behavior effect (‘Start Engine’) that getting executed.