Transition & Condition
- A transition is a change from one state to another.
- A transition a relationship between two states indicating that an object in the first state will perform certain actions and enter the second state when a specified event occurs and specified conditions are satisfied.
- On such a change of state, the transition said to fire.
- Until the transition fires, the object said to be in the source state; after it fires, it is said to in the target state.
- The transition is an instantaneous change from one state to another.
- E.g. when a called phone answered, phone line transition from ringing state to the connected state.
- Guard condition a Boolean expression that must be true in order for a transition to occur. E.g. Traffic light is an intersection may change if a road has cars waiting.
- Guard condition the condition fired when an event occurs, but only if guard condition is true.
- Guard condition checked only once, at a timed event occurs and transition fires if a condition is true.
- If the condition true later on, the transition does not fire them.
- UML notation for Guard condition written inside square brackets [ ] on transition and followed by an event.
- It is an optional condition.
Comparing Guard Condition and Change Event
- Guard condition checked only once while change event, in effect and checked continuously.
- Guard condition is the constraint, while Change event is a type of an event.