Creating state machine diagrams
You can use state machine
diagrams to illustrate the behavior of classes, collaborations, components,
nodes, operations, use cases, or entire systems.
Before you begin
- Creating state machines
You can create state machines to describe objects that have complicated or significant behavior. When you create a state machine, a single diagram and a region are created by default. A region is the container that holds the states and transitions that you add to the diagram to graphically describe the behavior of an object. You can create a state machine for classes, components, and operations. - Adding diagrams to state machines
A state machine diagram opens when you create a state machine. You can create a state machine diagram for classes, collaborations, components, nodes, and use cases. - Adding states and pseudostates to state machine diagrams
In state machine diagrams, you can describe the behavior of an object by adding states to a region of a state machine, composite state, or orthogonal state. - Adding regions to state machine diagrams
In UML state machine diagrams, a region is a container inside a state that can hold states, pseudostates, and transitions, which you can add to state machines or states. You can use regions to define nested states and transitions. Regions allow you to provide more detail about the internal transitions of a particular state. - Displaying the compartment titles of states
In UML state machine diagrams, states are divided into compartments. You can display the action and region compartment titles of states. - Creating transitions between states
In UML modeling, you can add transitions to a state machine diagram to show how an object changes state. A trigger, a guard condition, and an effect are the three optional parts of a transition. Add a trigger to a transition to show that an event must occur for a transition to initiate. Add a guard condition to a transition to show that a particular Boolean condition must be true for a transition to occur. Add an effect to a transition to show that an object performs a particular activity when a guard condition is satisfied. - Grouping state machine model elements into a new composite state
In UML modeling, you can group selected model elements in a state machine into a new state to hide the details of complex state machines. - Removing states from a composite state
In UML modeling, you can remove states from a composite state by dividing the composite state into its individual states. The composite state is removed from the state machine and replaced with the states that the composite state contained. - Adding entry, do, and exit activities to states
In UML models, you can add an entry, do, or exit activity to a state to describe an activity that is performed only upon entry into a state, exit out of a state, or that is ongoing in a particular state. - Creating state machines
You can create state machines to describe objects that have complicated or significant behavior. When you create a state machine, a single diagram and a region are created by default. A region is the container that holds the states and transitions that you add to the diagram to graphically describe the behavior of an object. You can create a state machine for classes, components, and operations. - Adding diagrams to state machines
A state machine diagram opens when you create a state machine. You can create a state machine diagram for classes, collaborations, components, nodes, and use cases. - Adding states and pseudostates to state machine diagrams
In state machine diagrams, you can describe the behavior of an object by adding states to a region of a state machine, composite state, or orthogonal state. - Adding regions to state machine diagrams
In UML state machine diagrams, a region is a container inside a state that can hold states, pseudostates, and transitions, which you can add to state machines or states. You can use regions to define nested states and transitions. Regions allow you to provide more detail about the internal transitions of a particular state. - Displaying the compartment titles of states
In UML state machine diagrams, states are divided into compartments. You can display the action and region compartment titles of states. - Creating transitions between states
In UML modeling, you can add transitions to a state machine diagram to show how an object changes state. A trigger, a guard condition, and an effect are the three optional parts of a transition. Add a trigger to a transition to show that an event must occur for a transition to initiate. Add a guard condition to a transition to show that a particular Boolean condition must be true for a transition to occur. Add an effect to a transition to show that an object performs a particular activity when a guard condition is satisfied. - Grouping state machine model elements into a new composite state
In UML modeling, you can group selected model elements in a state machine into a new state to hide the details of complex state machines. - Removing states from a composite state
In UML modeling, you can remove states from a composite state by dividing the composite state into its individual states. The composite state is removed from the state machine and replaced with the states that the composite state contained. - Adding entry, do, and exit activities to states
In UML models, you can add an entry, do, or exit activity to a state to describe an activity that is performed only upon entry into a state, exit out of a state, or that is ongoing in a particular state.
Related concepts:
Feedback