Counting messages with an opt fragment nested in a loop

A sequence diagram for placing an order shows the following. OrderController sends the synchronous call validate(order) to Validator and receives a reply. A loop fragment with the guard [for each line item] then contains the synchronous call reserve(sku, qty) from OrderController to Inventory and its reply; nested inside the loop, after that reply, an opt fragment with the guard [stock below reorder level] contains the asynchronous signal reorder(sku) from Inventory to Supplier. After the loop, OrderController sends the asynchronous signal confirm(order) to Mailer. An order has 6 line items, and reserving 2 of them leaves stock below the reorder level. How many messages, including replies, appear in this run? Give your answer as a whole number.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Sequence Diagrams Questions: