Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show "OR" statement in sequence diagram?

When drawing a sequence diagram , I saw that I need to implement an "OR" statement.Such as,

CUSTOMER can pay the bill to either WAITER or CASHIER.

Now,I have a paidBill() function which can pay either waiter or cashier. Please help to draw this.

like image 993
Nahid Hossain Shihab Avatar asked Oct 16 '25 21:10

Nahid Hossain Shihab


1 Answers

This is not really "OR", because that would imply that you can pay both Waiter and Cashier at the same time ("OR" is one, the other, or both). So what you want instead is if/else. This is denoted by combined fragments.

enter image description here

like image 112
Peter Uhnak Avatar answered Oct 19 '25 00:10

Peter Uhnak