State Machine icon State Machine
   

A state machine is a model element that represents the dynamic behavior of a classifier, operation, or package. More specifically, state machines represent the event-driven aspects of system behavior. State machines represent the various states an object goes through during its lifetime in response to events. Not all objects require state machines.

You can model state machines using statechart diagrams.

Typically, you create statechart and activity diagrams to model classifiers, operations, objects, or entire systems.

All state machines have a top-level composite state, which contain all other first-level state vertices (composite states, initial states, final states, choice points, and so on) in your diagram. Since there may be other state vertices contained within these composite states, the state containment hierarchy may be arbitrarily deep. A top-level composite state is automatically created whenever you create a state machine or an activity graph.