test.zenuml.mmd

    zenuml
        title Demo

        Alice

        @Database Bob

        J as John

        A.SyncMessage
        A.SyncMessage(with, parameters) {
          B.nestedSyncMessage()
        }

        new A1
        new A2(with, parameters)

        // 1. assign a variable from a sync message.
        a = A.SyncMessage()

        // 1.1. optionally give the variable a type
        SomeType a = A.SyncMessage()

        // 2. use return keyword
        A.SyncMessage() {
          return result
        }

        // 3. use @return or @reply annotator on an async message
        @return
        A->B: result

        Client->A.method() {
          B.method() {
            if(condition) {
              return x1
              // return early
              @return
              A->Client: x11
            }
          }
          return x2
        }

        // a comment on a message.
        // **Markdown** is supported.
        BookService.getBook()

        while(true) {
          John->Alice: Great!
        }

        if(is_sick) {
          Bob->Alice: Not so good :(
        } else {
          Bob->Alice: Feeling fresh like a daisy
        }

        opt {
          Bob->Alice: Thanks for asking
        }

        par {
          Alice->John: Hello guys!
        }

        try {
          Consumer->API: Book something
          API->BookingService: Start booking process
        } catch {
          API->Consumer: show failure
        } finally {
          API->BookingService: rollback status
        }