ProcessSample
State machine diagram
The life of one object: the states it can be in, the events that move it between them, and the conditions that must hold. Anything not drawn is not allowed.
Try this
- 01Fire events from Draft to Delivered. Only the buttons valid in the current state are enabled.
- 02Try to ship an order that is still Placed: impossible, because no arrow allows it. This is how status columns stay clean.
- 03Cancel after paying, then reset and return a delivered order: two different routes to an end.
Notation
- State (rounded box)
- A condition the object is in for a while (Paid, Shipped).
- Initial state (filled dot)
- Where every object starts.
- Final state (ringed dot)
- Where its life ends.
- Transition (arrow)
- A move from one state to another, triggered by an event.
- Event
- Something that happens (pay, ship). Written on the arrow.
- Guard [in brackets]
- A condition that must be true for the transition to fire.
Use it when
- Status columns and workflow engines (orders, tickets, claims)
- Validating which updates an API should accept
- Defining data quality rules for status transitions
Avoid it when
- Several objects or roles interact (use BPMN or a sequence diagram)
- The object has only two or three trivial states
More in Process
BPMN process diagram
Business Process Model and Notation: who does what, in which order, with decisions and parallel work, laid out in swimlanes.
Data flow diagram
Shows how data moves: from external entities, through processes that transform it, into and out of data stores. No timing, no decisions, just data.
UML sequence diagram
Who talks to whom, in what order, for one scenario. Time runs down the page; each arrow is one message between participants.