Question

If I have a state S1 with 2 transitions both with triggered by an event 'A', but one of them has as a guard x !=0 and the other doesn't. What would be the expected behavior when guard is valid (x ==1)?

  1. Unpredictable
  2. Transition with guard is taken
  3. Transition without guard is taken

I don't remember reading about not being able to have 2 transitions with the same event.

Was it helpful?

Solution

if x != 0, e.g. x== 1, then the transition with x == 0 is not enabled, the other, unguarded one is. the other is fired.

if x == 0, then both of the transitions are enabled. this is a situation of the so-called "conflicting transitions" (see UML Spec. 2.4.1., p. 575). Conflict resolution is generally rather complicated, see UML Spec. In your specific case, where both transitions leave the same state, the result is non-deterministic: either one of the transitions may be taken

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top