State Machine
Diagram
Eng. Diana Jouhari
UML
Diagram
Behavior Structure
Diagram Diagram
State
Activity Class Component Object
Machine
Diagram Diagram Diagram Diagram Diagram
Composite Deployment Package
Interaction Use Case
structure Diagram Diagram
Diagram Diagram Diagram
Profile
Diagram
Communication Interaction Sequence Timing
Diagram overview Diagram Diagram
Diagram
State Machine Diagrams concept
A state machine diagram models the behavior of a single object, specifying the
sequence of events that an object goes through during its lifetime in response
to events.
provide us an efficient way to model the interactions or communication that
occur within the external entities and a system.
A state of an object is controlled with the help of an event.
State diagrams are used to describe various states of an entity within the
application system.
used to model the event-based system.
state machine diagram:
shows the states that a door goes through during its lifetime
State machine components
• States state
• Initial and Final States
• Events
• Transitions
If /
• Decision box
else
State
• A state is a constraint or a situation in the life cycle of an object, in
which a constraint holds, so It is a specific moment in the lifespan of an
object the object executes an activity or waits for an event.
• A state machine diagram is a graph consisting of:
States (simple states or composite states)
State transitions connecting the states
• A state is denoted by a round-cornered rectangle with the name of the
state written inside it.
Initial and Final States
The initial state of a state machine diagram, is indicated with a
solid circle. A transition from this state will show the first real state
The final state of a state machine diagram is shown as concentric
circles.
Events
Events appear in the internal transition compartment of a state or on
a transition between states.
Transitions
Transitions from one state to the next are denoted by lines with
arrowheads.
Each transition line is labeled with the event that causes the
transition, and may have a trigger, a guard and an effect.
UML State Machine Diagram
Examples
Online Shopping System :
User Account
Online Shopping System :
Order
Online Shopping System :
Order
ATM
State Machine