State Diagrams
Create state machine and activity diagrams showing states, transitions, and parallel activities for documenting system behaviour.
State diagrams document the states a system can be in and the transitions between them. Activity diagrams show the flow of activities including parallel execution.
State Machine Diagrams
State machine diagrams show:
Creating State Diagrams
Transition Labels
Label transitions with the format: event [guard] / action
| Element | Description |
|---|---|
| event | What triggers the transition |
| guard | Condition that must be true (optional) |
| action | What happens during transition (optional) |
Activity Diagrams
Activity diagrams show the flow of activities:
Creating Activity Diagrams
Parallel Activities
Show parallel execution with fork and join:
Common State Patterns
Order Lifecycle
Draft, Submitted, Processing, Complete, Cancelled.
Document Workflow
Draft, Review, Approved, Published.
User Session
Anonymous, Authenticated, Active, Suspended.
Issue Tracking
Open, In Progress, Review, Done.
Best Practices
Name States Clearly
Use adjectives or past participles.
Show All Transitions
Document every state change.
Label Events
What causes each transition.
Include Error States
Failed, Error, Cancelled.
Keep Focused
One diagram per entity lifecycle.
Version Control
State machines change with requirements.