UML State Machine Diagram

State machine diagrams were covered as part of the Software Engineering module (COM00144M) during my MSc studies with the University of York. This post will detail my findings and provide information and examples on how to create state machine diagrams.

What is a state machine diagram?

State machine diagrams are used to model the events an object can go through. They visualise the steps of a process and show the different paths that can be taken from one state to another during its lifetime.


Each state is shown by a single rounded rectangle, the name of the state is written inside.

State machine state example

States can contain further optional detail in the form of these additional properties:

  1. Entry – An action that is performed on entry to the state
  2. Do – An action that is performed while in the state
  3. Exit – An action that is performed on exit of the state
  4. Defer – An action that occurs when the current state is exited and triggered from another state
State machine expanded state example
Read More