UML state machine diagram template: order lifecycle
The states an order moves through, and the events that move it.
About this template
A state diagram describes one object over time: the states it can be in and the events that move it from one to the next. It is the right tool when the question is "what is allowed to happen now?", for example whether a shipped order can still be cancelled.
This template follows an order from creation to one of three endings. Each arrow is labelled with the event that triggers it, which is exactly the list of transitions your code has to handle.
What is in the diagram
- Initial state
- The filled dot. It points at the state every new order starts in.
- States
- Rounded rectangles named as conditions: Pending, Paid, Shipped.
- Transitions
- Arrows labelled with the triggering event.
- Final state
- The ringed dot. Delivered, cancelled and refunded orders go no further.