State transition diagrams show the life history of a given class, the events that cause a transition from one state to another, and the actions that result from a state change. This life cycle is expressed in terms of the different states that the various objects can find themselves and the events that cause the transitions of their states.
Actions and activies are implemented the same but are treated differently. Actions are associated with transitions and are considered to occur quickly and are not interrupted, while activities are associated with states and can take longer.
Figure 18 Components of a state transition diagram
Figure 19 shows guarded transitions. A guard condition is a conditional expression in terms of attribute values that prevents a transition from occurring unless the condition is true. In the following fig. the state moves from OK to Overdrawn if [balance < amount] which is the guard condition. The transitions that start and end in the same state are called self-transitions.
Figure 19 Example state transition diagram
UML also defines concurrent state transition diagrams (see e.g. Fowler, 2000a). In the concurrent sections of such a state diagram the given object is in two different states, one from each diagram. When the object leaves the concurrent states, it is in only a single state. Concurrent state transition diagrams are useful when a given object has sets of independent behaviours.