Nesting substates within a state helps you to simplify the modeling of complex behaviors. You model sequential, mutually exclusive disjoint substates to show that the modeled element can be in one of the substates at a time (cannot be in two substates concurrently). The following diagram, from The UML User Guide, provides an example of nested sequential substates:
•From a source outside an enclosing superstate, a transition can target the superstate or a substate within it. If the transition targets the superstate, then the superstate must have an initial state within it. If the target is a substate within the superstate, then control passes to the substate after dispatching the entry action (if any) of the superstate and the entry action (of any) of the substate.
•The superstate can have at most one initial state and one final state.
•Within the superstate, a transition to the final state represents the completion of activity in the superstate.
•A transition can leave the superstate from the superstate itself, or from a nested state. If the transition leaves from a nested state, the nested state's exit action is dispatched and then the superstate's exit action (if any) is dispatched. A transition that leaves from the superstate essentially cuts short (or interrupts) the activity of the nested state machine.