How to represent an if statement on a sequence diagram in DIA?

16,755

Based on the "alt" box depicted in the IBM link given by @luistm, I was able to replicate something similar in Dia:

UML Sequence Diagram with "alternative combination fragment"

The "alt" box was drawn with the UML Large Package object. (The Small Package doesn't allow you to resize it.)

The condition labels are just Text objects (found on the upper [static] pane in the left toolbar, marked with the T).

The dotted line is just a Line object (from that same static toolbar pane), with the arrowhead set to a plain line, and with the body set to dotted (done at the bottom of the left tool pane, with those 3 arrow segments).

I had to play with the Objects menu items Send to Back, Bring to Front, Send Backwards and Bring Forwards, to get it all to look right without things obstructing one another. Also I had to frequently use the View menu's Refresh command to check myself; often the drawing would mess up the stacking order and overlapping, but the Refresh would put things right again.

It doesn't look exactly like the diagrams at the IBM link (label outside main box instead of inside, box border obstructed by lifeline, etc?), but I think this is the best we can do with Dia's stock UML objects.

Share:
16,755
luistm
Author by

luistm

Updated on June 09, 2022

Comments

  • luistm
    luistm almost 2 years

    Does anyone know how to represent an if statement on a sequence diagram in DIA?