Where is " alt " tool (in order to create an "If else" condition) in IBM Rational Rhapsody?

428 Views Asked by At

Where is alt tool (in order to create an "If else" condition) in IBM Rational Rhapsody in a Sequence Diagram?

P.S. Preferably with an example.

Suggestion: Is it correct to use Guard conditions (or simply Guards) before a message? (Like this: [Guard Condition] message) And if yes, can this solution be used rather than alt fragment?

Rhapsody tools:

enter image description here

Edit: I finally used Interaction Operation tool and it seems that it works for if condition, but I do not know how to add the else to achieve something like this: link

Related question: How to show "if" condition on a sequence diagram?

2

There are 2 best solutions below

1
Andreas Schätti On

You can add an Operand Separator to your Interaction Operator and specify separate conditions in each part of the Interaction operator (see an image of a simple example here).

Please follow the instructions in the official documentation.

0
Julia On

Very simple : Use interaction operator and click "opt" in the left corner. Change the title to "loop" for your if statement. Create a second and change the title to "alt" for your else.

In the example shown on IBM documentation, there are two interaction operators for the if and the else. The answer below mine suggests an operand separator, but I wouldn't recommend that, because they will both be loop or alt. You can use operand Seperator for multiple else statements.