Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One transition with multiple events in UML State diagram

We are learning in school that behavioral State diagram's transition has syntax:

list of events [guard condition] / list of actions

But I couldn't find any example on Internet where is used transition with multiple events. Is it really possible? If yes, how does it behave? Does it mean that transaction is realized when one of this events occurs (and of course condition is fulfilled)?

like image 419
MacakM Avatar asked Mar 10 '23 19:03

MacakM


2 Answers

Yes, a transition can be triggered by one of many events in a list. You would use such a construct to avoid multiple lines between states, making a tidier diagram.

Here is what the 2.5 spec says:

14.2.3.9.2 Enabled Transitions

A Transition is enabled if and only if:

  • [ . . . ]

  • At least one of the triggers of the Transition has an Event that is matched by the Event type of the dispatched Event occurrence.

These logically OR'ed transitions are specified textually as a comma-separated list on the transition, as specified in §14.2.4.9:

[<trigger> [‘,’ <trigger>]* [‘[‘ <guard>’]’] [‘/’ <behavior-expression>]]
like image 172
Jim L. Avatar answered Mar 16 '23 12:03

Jim L.


Unfortunately the UML spec is not specific in that respect (I thought, but Jim has the right answer). Anyway:

14.2.4.9 Transition

The default textual notation for a Transition is defined by the following BNF expression:

[<trigger> [‘,’ <trigger>]* [‘[‘ <guard>’]’] [‘/’ <behavior-expression>]]

Where is the standard notation for Triggers (see sub clause 13.3.4), is a Boolean expression for a guard, and the optional is an expression specifying the effect Behavior written in some vendor- specific or standard textual surface language (see sub clause 16.1). The trigger may be any of the standard trigger types. SignalEvent triggers and CallEvent triggers are not distinguishable by syntax and must be discriminated by their declaration elsewhere.

There are other places in the specs where this paragraph appears in similar way, but without explaining how multiple triggers will be treated. I assume that it's an OR-condition. But that's only an assumption. Alas, since you have not seen examples (me neither) it is probably an unknown fact. Just don't use it - that's indeed possible ;-) And if you happen to find an example, just ask the author what he meant. UML is about talking to each other.

like image 40
qwerty_so Avatar answered Mar 16 '23 11:03

qwerty_so