I know alt is the equivalent of if else in UML, but how to represent a more complex condition like:
if (condition1 && condition2) else condition3
Is it [condition1 == true]&&[condition2==true] ?
I know alt is the equivalent of if else in UML, but how to represent a more complex condition like:
if (condition1 && condition2) else condition3
Is it [condition1 == true]&&[condition2==true] ?
The guard in the operand of a combined fragment such as
altis an interaction constraint expressed between a pair of square brackets. Therefore, your condition should stay between one pair of brackets.UML offers full flexibility about how to specify such a constraint:
In other words, with the guard brackets
[condition1 && condition2]is perfectly fine. If you prefer OCL syntax, it would be[condition1 and condition2].