In the state diagram of a UML machine, two arrows from the same state

In this example: enter image description here

What are the conditions for the transition from S0 to S2? Should the values ​​of e1 and [x == 6] be true , or is it enough that only one of them is right to go into state s2?

+4
source share
2 answers

These are two separate transitions, so only one event is needed.

You did not ask, but remember that when in state s1 the event e1 is nondeterministic. The reason is that there are two competing transitions.

I will point out, as @thomas suggested, that you can force the guard to also apply to the e1 event by adding this protector to this event. It will look like e1[x==6].

+5
source

UML (. " " 15.3.12 UML 2.4.1), , s0, e1, . , s2 - e1 , true, , , s2. BTW, , S2, x 7 s2 - s1.

+1

Source: https://habr.com/ru/post/1628693/


All Articles