Skip to content
State machine (FSM) templates

Elevator (State Machine)

Movement and door states of a lift.

Template previewState machine (FSM)
Elevator4 states · 5 transitions · 4 eventscall_abovecall_belowarrivearrivecloseIdleMovingUpMovingDownDoorsOpenAll 4 states are reachable and every transition names states that exist.INFONo state is marked `final`, so this machine never terminates. That is ordinary for a reactive controller and a smell for a workflow.OKAll 4 states are reachable from `Idle`.OKAll 5 transitions name states that exist, so every arrow in the figure is drawn.

Make it your own.

title "Elevator"
state Idle
state MovingUp
state MovingDown
state DoorsOpen
initial Idle
transition Idle -> MovingUp on "call_above"
transition Idle -> MovingDown on "call_below"
transition MovingUp -> DoorsOpen on "arrive"
transition MovingDown -> DoorsOpen on "arrive"
transition DoorsOpen -> Idle on "close"