Question
When an alt frame is used in a sequence diagram, and one of the two possibility end the sequence, how is "legal" to continue?
example
I need to represent a sequence in wich there are user and atm
- the user insert card
- the atm verify card
- if card is valid, then it confirm card to user and the sequence continue
- if not it to user and the sequence Stop
can someone represent this simple example?
I made this sequence:
image
Is correct?
I assume that the part follow the alt frame imply that "good" case is verified?
Or I need to put all of the sequence of "good case" in the "good case alternative section"?
how can I handle this situation?
Thank's in advance!
1 Answer 1
I assume that the part follow the alt frame imply that "good" case is verified?
No, that assumption is incorrect. The part following the alt frame will be done when either part of the alt frame completes.
Or I need to put all of the sequence of "good case" in the "good case alternative section"?
Yes, all the steps that belong to the "valid card" alternative of the alt frame need to be shown within that portion of the frame.
If that clutters your diagram too much, you can also draw a seq frame inside the alt frame. The seq frame contains the name of another sequence diagram that describes the steps happening at that point.
Another option is to use a break frame. That would contain the steps for an invalid card (with a guard condition). Either the content of the break frame is executed, or the part of the sequence diagram below the frame.
-
You forgot to mention the
break
fragment. See stackoverflow.com/questions/38293030/…www.admiraalit.nl– www.admiraalit.nl2019年09月09日 10:13:50 +00:00Commented Sep 9, 2019 at 10:13 -
@www.admiraalit.nl: I was not aware of the break fragment, but I added it now.Bart van Ingen Schenau– Bart van Ingen Schenau2019年09月09日 17:46:57 +00:00Commented Sep 9, 2019 at 17:46
ask for PIN
rather thaninsert PIN
. Andinvalid card
should be a return message (dashed line).