State machine diagram is a kind of UML diagram that shows flow of control from state to state within single object. It usually contains simple states, composite states, composite states, transitions, events and actions.
Creating state machine diagram
Perform the steps below to create a UML state machine diagram in Visual Paradigm.
- Select Diagram > New from the application toolbar.
- In the New Diagram window, select State Machine Diagram.
- Click Next.
- Enter the diagram name and description. The Location field enables you to select a model to store the diagram.
- Click OK.
Creating states and transitions
After creating a state machine diagram, an initial pseudo state appears by default. You can create other states by using Resource Catalog:
- Move your mouse pointer over the source state.
- Press on the Resource Catalog button and drag it out.
- Release the mouse button at the place where you want the state to be created.
- Select the state to be created from Resource Catalog.
- A new state will be created and is transited from the source state. Enter its name and press Enter to confirm editing.
Adding region to state
To model substates of a composite state, you need to add one or more regions to it. To add a region, right-click the state and select Add Horizontal Region from the popup menu.
Next, you can draw the substates inside the region.
Modeling properties of transition
To model properties of transition such as effect and guard, right-click the transition and select Open Specification… from the pop-up menu.
When the Transition Specification pops out, you can edit its name, effect and guard. Next, select Create Activity… from the Effect property.
In Activity Specification (Effect) window, change its name and then click OK button to apply the change.
Click OK in the Transition Specification to close it. The name and effect are shown on the transition caption.