BA Prince the B.A. Subscribe

Home / draw.io for Business Analysts

State Diagram in draw.io: Order Status Lifecycle

State Diagram in draw.io: Order Status Lifecycle

Watch on YouTube Subscribe

A state diagram shows every status a thing can have and what moves it from one status to the next. Learn how to draw a UML state machine for free in draw.io: the start dot, states, transitions labelled with their trigger, and the final state, using an online shop order.

Step by step

Statuses on one page

  1. State diagrams. A state diagram shows every status something can have and which status can follow which. Writing this down stops gaps in your requirements. The example is an online shop order that can be placed, paid, shipped or cancelled.
  2. Blank diagram. Start a blank diagram in draw.io.
  3. UML shapes. Click More Shapes, tick UML 2.5 and click Apply. This library has the state diagram shapes.

Start and states

  1. Start dot. Every state diagram begins with a solid black dot. It marks the start and is not a status itself. Drag it from the UML 2.5 shapes onto the page.
  2. State. A state is a rounded box named after the status the order is in. Drop a State shape and name it Placed. Hover over the start dot and drag its blue arrow onto Placed. Every new order starts here. Add the next state to the right of Placed and name it Paid.

Transitions

  1. Trigger label. An arrow between 2 states is a transition. Connect Placed to Paid and label the arrow with its trigger, the event that moves the order on: payment OK.
  2. State. Next the order is shipped. Add a third state named Shipped.
  3. Trigger label. Connect Paid to Shipped and label the arrow picked up. The trigger is the courier collecting the order.

The final state

  1. Final state. Once the order is delivered, its life is over. That is the final state, a dot inside a ring. Drop it under Shipped. Connect Shipped down to the final state and label the trigger delivered.

Another path

  1. Cancelled. A placed order can also be cancelled. Add a state named Cancelled under Placed. Connect Placed down to Cancelled and label the trigger customer cancels. A cancelled order is finished too, so connect Cancelled to the same final state. People often forget this arrow and leave a status going nowhere.
  2. The finished lifecycle. Click an empty part of the page to see the whole lifecycle: 1 start dot, 4 states and the final state, with the triggers written on the arrows.

Recap

  1. The rules. The rules: start with the black dot, name states as statuses, label each transition with its trigger, and make every path reach the final state.

Common mistakes

  • Naming states as actions. A state is a status the order sits in, like Paid, not a task like Take payment. The event goes on the arrow as the trigger.
  • Arrows with no trigger. An arrow with no label doesn't say when the move happens. Write the event on each transition, like payment OK or picked up.
  • A status that goes nowhere. Every path must reach the final state. In the example, Cancelled needs its own arrow to the final state, or readers can't tell if a cancelled order is finished.
  • Treating the start dot as a status. The black dot only marks where the lifecycle begins. Don't give it a status name like New. Draw a first state such as Placed and connect the dot to it.

When a business analyst uses this

In a requirements workshop for an order system, draw the order lifecycle live with the stakeholders. Each arrow becomes a business rule, such as "an order can only be cancelled while Placed". Missing arrows show the questions to settle before sign-off, such as whether a Paid order can still be cancelled.

Questions people ask

How do I draw a state diagram in draw.io?

Add the UML 2.5 library through More Shapes, then use its start dot, State boxes and final state. Connect the states with arrows and label each arrow with the event that triggers it.

What is a state diagram in UML?

A UML state machine diagram shows the statuses one thing can be in and the events that move it from one status to the next. It begins at a black dot and ends at a final state, a dot inside a ring.

Is a state transition diagram the same as a state machine diagram?

Yes, both names describe statuses joined by transitions. UML calls it a state machine diagram, and people also say state diagram, state chart or state transition diagram.

More in draw.io for Business Analysts