Event Signature: empty string or event name followed by a list of event-parameters in parentheses. You can chose to leave out parameter type.
Guard: Boolean expression in square brackets
Action Expression: is optional. A description of a computation done when the transition occurs
Optional Parts of a Transition in State Diagram
Trigger: the cause of the transition. Can be a signal, an event, a change in some condition, or time passing
Guard condition: a condition that must be true for a trigger to cause the transition
Effect: an action that happens directly on the object that owns the state as a result of the transition
State Diagram Execution
There is always a current state
Execution starts in initial state
Event occurs
If a transition has an action-expression, the action occurs when the transition takes place
Machine stops when final state becomes current state
What happens when an event occurs ?
If event matches an event-signature on a transition from the current state and the guard is absent or true: the transition occurs and the current state becomes the target state.
If it does not match an event-signature or the guard is false: no change of state occurs
If the computation occurring in the current state completes, andthere is a transition from the current state with no event-signature:
Guard is absent or true: the target state becomes the current state.
Guard is false: no change of state occurs.
Internal Transitions
Entry: execute the action-expression when you enter the state
Exit: execute the (exit) action-expression while leaving state
Do: execute the (do an activity) action-expression when you enter the sate up until you exit
Include: action-expression names a finite process. This process is a placeholder for a nested state diagram
Sequence Diagram Notation
Objects are rectangles with names underlined and at the top
message are solid line arrows
Time is vertical
Lifelines are dashed lines extending down from objects
Activation is: rectangle on each lifeline. It represents an operation that the object does. The length is how long it takes to do the operation.
Truncated lifeline: ' X '
Solid line with triangle arrow: sync msg
Solid line with ->: Async msg
--->: sync msg return/ create instance
Interaction Fragments
Show types of message flow like loops, branches, parallel execution
ALT: does 1/2 actions depending on state
OPT: Executes if given condition is true
LOOP: executes multiple times based on guard
SD: surrounds entire sequence diagram
BREAK: checks if guard is true and does what's inside. If guard is false, break skips