Skip to content

Composite State

A composite state is a state that has at least one region. A region is a part of the state that holds its own inner states. See State Machine Diagram for the basics.

Orthogonal composite states. A composite state with two or more regions is called orthogonal. Its regions run concurrently, meaning at the same time. See Concurrent Region for more.

Starting and finishing. Each region may have its own initial state indicator and its own final state. A region has at most one initial indicator. An initial pseudostate is a marker, not a real state. It is the source of a single transition to the default state of the composite state. This is called default entry.

A transition to a final state completes the region that contains it. When all orthogonal regions complete, the enclosing composite state is complete.

History. A composite state can remember where it was.

  • Shallow history restores the most recent active substate of the containing state.
  • Deep history restores the most recent active configuration of the composite state.

Fork and join. These connect transitions to targets or sources in different orthogonal regions. All transitions leaving a fork must target states in different regions of an orthogonal state.

Imagine a checkout screen modeled as one composite state called Checkout. It has two regions. One region tracks payment steps. The other tracks delivery choices. Each region starts at its own initial indicator and ends at its own final state. When both regions reach their final states, Checkout is complete.

A composite state with two concurrent regions, each with its own initial and final state.

Diagram source
@startuml
[*] --> Checkout
state Checkout {
[*] --> EnterPayment
EnterPayment --> PaymentDone
PaymentDone --> [*]
--
[*] --> ChooseDelivery
ChooseDelivery --> DeliveryDone
DeliveryDone --> [*]
}
@enduml
  • Each region of a composite state has at most one initial state indicator.
  • Fork transitions leaving a fork target states in different regions of an orthogonal state.
  • Composite states with two or more regions are treated as orthogonal, with regions running concurrently.
  • composite state — 2022.help.altair.com, accessed 2026-11-09
  • — site.uottawa.ca, accessed 2026-11-09