
Adding a condition to a transition
A condition guards a transition, and will only allow movement to the next state when and if the condition evaluates to "True".
About this task
If an exception occurs while processing a condition, the exception is ignored, and the condition for the next triggered transition, if any, is checked.
If a state defines more than one transition
that uses the same triggering event, then all of those transitions
must define guard conditions. More to the point, if a state defines
an outbound, unguarded transition, then that state cannot have any
other outbound transitions that use the same triggering event. If
the triggering event is the completion event, then the state cannot
have any other outbound transitions at all. The one exception to this
rule is for composite states, which can both define a default transition
and also define exception transitions.
To
add a condition to a transition, proceed as follows:Important: The
visual or Java™ code should not change the
value of variables. Any such changes will be ignored (the variables
will have the same values before and after the condition is evaluated).
