Overview

State Machine diagram falls under the behavioral diagramming family. A State Machine diagram is a graph that represents a State Machine. States and various other types of vertices (pseudostates) in the State Machine graph are rendered by the appropriate State and Pseudo States symbols, while Transitions are generally rendered by directed arcs that interconnect them. The states can also contain subdiagrams by a physical containment or tiling. Note that every State Machine has a top State containing all the other elements of the entire State Machine. The graphical rendering of this top state is optional.

State Machine. The State Machine is a specification of the sequence of states an object or an interaction undergoes in response to events during its life, combined with its responsive actions. The State Machine can represent the sequence of states of a particular collaboration, e.g. collection of objects, or even the whole system, which is also considered a collaboration. The abstraction of all possible states defined in a State Machine is similar to the way Class diagrams are abstracted: all possible object types (classes) of a particular system are described.

Purpose

A State Machine diagram (also called Statechart diagrams) represents the behavior of entities capable of dynamic behavior by specifying their response to the receipt of event instances. Typically, State Machine diagrams describe the behavior of Classes, but the Statecharts can also describe the behavior of other model entities. such as Use CasesActorsSubsystemsOperations, or methods.

Usage

A State Machine diagram can be used to:

  • describe how an object moves 
  • show the behavior of a State Machine or a related set of State Machines
  • illustrate Use Case scenarios 
  • depict event-driven objects

Summary

State Machine diagrams are valuable because they:

  • identify events an object will/will not respond to depending on the object's current state
  • identify the specific responses of an object to everything that can happen to it
  • discover and validate the data that is needed to define the state of the object and affected attributes
  • help to discover the internal effects of behaviors.


Example of a State Machine diagram