Reputation: 33
How do I handle more than one condition (with different boolean expressions) in a UML state machine transition (as guard)?
In this example I would like to add more than only one condition (Tries < 3) in the transition from "logging in" to "Logged In" like discribed in the note.
How to handle this UML compliant?
Upvotes: 3
Views: 4790
Reputation: 36323
Simply spoken (and to focus on the needed step)
put a boolean condition like above in the Guard
. This can be any text. You can write C-style or plain text. I'm not sure about OCL here, but that's for academic purpose anyway (my opinion).
N.B. Your diagram shows Tries = 3
which should be a Guard
also (i.e. [Tries = 3]
) rather than a Name
.
Upvotes: 3
Reputation: 11274
There are a couple of options here:
All of these are valid UML syntax. But note that just because something is valid doesn't mean it will be supported in your editor. For example it was many years before most of the features of sequence diagrams became available within editors...
Upvotes: 2