Summary

Shows how a single object behaves across many cases.

State Diagram

  • Syntax for a transition label is: state1 event [guard] / action state2
  • Not all events cause state transition, some events are ignored in some states.

Internal Transition

Not the same with Self-transition

When trigger question-received in self-transition, the state will exit and re-entry again, trigger both exit action and entry action.

Events

  • CallEvent: an event that occurs when an operation is called.
    • go-up(floor)
    • go-down(floor)
  • SignalEvent: an event that occurs when a signal is received.
    • floor-reached(floor)
  • ChangeEvent: an event that occurs when a condition becomes true.
    • when(...)
  • TimeEvent: an event that occurs at a specific time or after a certain duration.
    • after(...)

Convert to Class Diagram