0

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?

Questioner
  • 662
  • 1
  • 10
  • 26
  • Without knowing the tool you should go for Interaction Occurence or Operator. – qwerty_so Oct 17 '21 at 22:30
  • @qwerty_so , 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](https://www.ibm.com/docs/en/rsas/7.5.0?topic=diagrams-combined-fragments-in-sequence) – Questioner Oct 17 '21 at 23:51
  • I would further guess that you can fiddle with the Interaction's properties. But don't ask me how... – qwerty_so Oct 18 '21 at 06:45

2 Answers2

0

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.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 02 '21 at 12:02
0

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.

Julia
  • 1
  • 1