# ZenUML sequence diagram in Markdown to PDF

Sequence diagrams are written the way code reads: method calls, nested blocks, conditions and return values, in ZenUML syntax.

Sequence diagrams written as method calls with blocks, conditions and return values, in ZenUML syntax, for the order service of an online pharmacy.

- PDF: https://legivel.com/examples/mermaid-diagrams/zenuml-sequence-diagram.pdf
- Page: https://legivel.com/examples/mermaid-diagrams/zenuml-sequence-diagram
- Open in the editor: https://legivel.com/markdown-to-pdf?sample=mermaid-zenuml
- More mermaid diagrams in Markdown to PDF: https://legivel.com/examples/mermaid-diagrams

## Markdown source

````markdown
---
title: Order service, call sequence
author: Platform team
---

# Placing an order: the call sequence

The online pharmacy of a Danish chain checks the prescription before it takes payment. The sequence is written as method calls.

```mermaid
zenuml
  title Place order
  @Actor Customer
  @Boundary Shop
  @Control OrderService
  @Database Orders
  @Starter(Customer)
  Shop.checkout(cart) {
    OrderService.create(cart) {
      if(prescriptionNeeded) {
        OrderService.checkPrescription()
      }
      Orders.save(order)
      return orderId
    }
  }
```

Orders without a prescription item skip the check and go straight to payment.
````
