UML Modelling:State Diagram
State diagram is mainly used in describing the dynamic behavior of an object during its existence, performance for the sequence of States that experienced by an object, cause a events of State transition (Event), and the action trigged by State transition(Action). Generally we can use a state machine for modeling the life cycle of an object, state diagrams are used to display the state machine (State Machine Diagram), focusing on the control flow of describing state diagram.
The sample below, showed the state diagram of Door, caused the transfer event, and accompanied by the state transition actions ( action ).
Status include Opened,Closed,Locked. Events include Open,Close, Unlock.
A. Not all the events will trigger state transition, for example when the door is opened, the event locked will not happen.
B. There is guard condition in transition, for example only doorWay->isEmpty, the event would happen.