Behavior : State Machine Diagrams - Transitions - Guard Conditions

7 important questions on Behavior : State Machine Diagrams - Transitions - Guard Conditions

A Guardian Condition can be a :

  • It can be a Boolean expression involving properties values of the current object

  • parameters of the incoming event

  • or property values of reachable objects.

How does Guardian Conditions work?

When an event arrives at an object that is potentially interested in that event, the transitions of that object are examined to determine of any active state depend on the arriving event.

If any are found, their guard conditions are evaluated.

Which conditions can you have on a Guardian Condition?

  • True:  If a true guard condition is found, the transition fires and any ongoing behaviors in the current state are interrupted.

  • False :If a guard condition that evaluates to false is found, the search continues looking for another possible candidate transition.

  • Multiple Transitions: If multiple transitions have guard conditions that evaluate to true for the same event, the transition chosen may be arbitrary.

It is possible for a guard condition to test the state of a reachable object [Object Path] in State 1 or [Object Path] not in State 2.

Why is the Object Path needed?

The Object Path is needed to indicate the actual object to test.

Where is the guard condition placed?

The guard condition is placed after the event on the transition line.

It is surrounded by square brackets


In some circumstances, the state machine rules are easier to see when presented in a ....

State Transition Table format

Especially when you see it in the table format, the commonality of the response in the Borrowed Book state to the Returned event is a bit more apparent. It can be (reverse) factored out to make the diagram easier to understand.

What is a "Static Conditional Branch"

This Junction (the black dot) is called the STATIC CONDITIONAL BRANCH because the branch taken is determined beforehand and not reevaluated dynamically

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart