Reputation: 177
What are the conditions to move from S0 to S2? Does e1 and [x==6] need to be true, or is it enough that only one of them will be true to move to the s2 state?
Upvotes: 3
Views: 749
Reputation: 11
In UML, internal transitions have priority over external ones (see "transition selection algorithm" in section 15.3.12 of the UML 2.4.1 spec), so while in s0, getting e1, will always fire the internal transition. So the only way to move to s2 is sending e1 three times which will turn the condition of the guard to true and thus the run to completion step will take the transition to s2. BTW, even though the guard will be enabled and the transition to S2 will occur, the value of x will actually be 7 when reaching s2 because of the exit action of s1.
Upvotes: 1
Reputation: 6529
Those are two separate transitions, so only one event needs to fire.
You didn't ask, but be aware that when in state s1, event e1 is non-deterministic. The reason is that there are two competing transitions available.
I'll point out, as suggested by @thomas, that you could make the guard also apply to the event e1 by adding that guard to that event. It would look like e1[x==6]
.
Upvotes: 4