Using Alternative Combined Fragments in Sequence Diagram
A combined fragment is used to specify an area of a group of lifelines/actors to show conditional flow in a sequence diagram. Alternative combined fragment models the if-then-else logic in the sequence diagram.
Create a new sequence diagram and draw the following sequence diagram.
Create an alternative combined fragment covering the
Person and
ATM Machine LifeLines.
Draw an
Ask for Password message from
ATM Machine to
Person LifeLine in the upper compartment of the alternative combined fragment. And draw a
Display Invalid Card message from
ATM Machine to
Person LifeLine in the lower compartment of the alternative combined fragment.
Right-click on the combined fragment, select
Open Specification... from the pop-up menu. A
Combined Fragment Specification dialog box is displayed.
Select the
Interaction Operands tab, select the InteractionOperand and click
Open Specification... button. An
Interaction Operand Specification dialog box is displayed. Select the
Guard tab and put Valid Card as the constraint. Click on
Apply button to confirm the changes.
Repeat step 5 for
InteractionOperand2 and put
Invalid Card as the constraint for the Guard condition.
Guard Conditions are displayed in the upper and lower compartment of the alternative combined fragment.
Related Articles
Resources