Title: UML State Machine Diagrams
1UML State Machine Diagrams
2Agenda
- State Machine Diagram Symbology
- State Machine Diagram Exercise
3 State Machine Diagrams
- Describe how an objects (classs) state changes
in response to external events - State diagrams derived from Harels statecharts,
now called Statechart - Allow embedded state machines to account for
state-space explosion - Make one per CLASS or one for SYSTEM
- Use state diagrams for external events, use
interaction (Sequence) diagrams for internal
events (messages).
4State Machine Key Terms
- State
- Transition
- Activity
- entry, exit, do, include, internal_event
- Action
- Event
5State Machine Symbology
Normal State
Start/Initial State
Stop/Accepting/Final State
Transition
6Transition Text Syntax
EventName(parameter list) Guard / Action
Special Events After x seconds When (time1200)
Special Guards in StateName not in
StateName
right-mouse-down (location) location in window
/ object pick-object (location)
object.highlight ()
7Basic State Machine, Order Entry
Not all items checked / getNextItem
All items checked All items available
do/initiate delivery
do/check item
All items checked Some items not in stock
transhipped
cancelled
Item Received Some items not In stock
cancelled
8Another Sample State Machine
9Order Entry With Concurrency
Ordering
waiting
OUT
IN
IN
checking
shipping
OK
authorizing
authorized
10(No Transcript)
11Lab 3 State Machine Exercise