简体   繁体   中英

How to show “if” condition without else in sequence diagram

I want to know how do you design an if condition that doesn't have an "else" in your sequence diagrams? I don't know if I have to do it with an alternative because I will have just one case or nothing, so I will not have any alternatives. Thank you for your answers.

There is no need to include multiple operands.

The specs (17.6.2) just require that you have at least one operand per fragment (there are no additional constraints for alt kind).

在此处输入图片说明

So you can do just that

在此处输入图片说明

Also as Thomas noted, you can use opt , which is equivalent (emphasis mine):

An opt ion is semantically equivalent to an alt ernative CombinedFragment where there is one operand with non-empty content and the second operand is empty.

Use an opt fragment like this

在此处输入图片说明

The condition is shown in square brackets. I think, an alt would also do with just one case.

I just found this document http://www.omg.org/news/meetings/workshops/MDA-SOA-WS_Manual/00-T4_Matthews.pdf in page 54 I found Opt. I searched in the Internet and it seems that it's exactly what I was asking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM