


In the transition example above, an effect was associated with the transition. "Effect" is an action which will be invoked directly on the object that owns the state machine as a result of the transition. "Guard" is a condition which must be true in order for the trigger to cause the transition. "Trigger" is the cause of the transition, which could be a signal, an event, a change in some condition, or the passage of time. A transition may have a trigger, a guard and an effect, as below. Transitions from one state to the next are denoted by lines with arrowheads. The final state is denoted by a circle with a dot inside and may also be labeled with a name. The initial state is denoted by a filled black circle and may be labeled with a name.
#LOGICWORKS STATE MACHINE FULL#
The syntax and conventions used in state machine diagrams will be discussed in full in the following sections.Ī state is denoted by a round-cornered rectangle with the name of the state written inside it. Also notice that a state transition can have a guard condition attached: if the door is Opened, it can only respond to the Close event if the condition doorWay->isEmpty is fulfilled. Notice that not all events are valid in all states for example, if a door is opened, you cannot lock it until you close it. It can respond to the events Open, Close, Lock and Unlock. The door can be in one of three states: "Opened", "Closed" or "Locked". UML 2 Tutorial - State Machine Diagram State Machine DiagramsĪ state machine diagram models the behaviour of a single object, specifying the sequence of events that an object goes through during its lifetime in response to events.Īs an example, the following state machine diagram shows the states that a door goes through during its lifetime.
