zenuml
    title Demo

    Alice

    @Database Bob
    
    J as John

    A.SyncMessage
    A.SyncMessage(with, parameters) <beginfold id='1'>{</beginfold id='1'>
      B.nestedSyncMessage()
    <endfold id='1'>}</endfold id='1'>

    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() <beginfold id='1'>{</beginfold id='1'>
      return result
    <endfold id='1'>}</endfold id='1'>

    // 3. use @return or @reply annotator on an async message
    @return
    A->B: result
    
    Client->A.method() <beginfold id='1'>{</beginfold id='1'>
      B.method() <beginfold id='1'>{</beginfold id='1'>
        if(condition) <beginfold id='1'>{</beginfold id='1'>
          return x1
          // return early
          @return
          A->Client: x11
        <endfold id='1'>}</endfold id='1'>
      <endfold id='1'>}</endfold id='1'>
      return x2
    <endfold id='1'>}</endfold id='1'>

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

    while(true) <beginfold id='1'>{</beginfold id='1'>
      John->Alice: Great!
    <endfold id='1'>}</endfold id='1'>

    if(is_sick) <beginfold id='1'>{</beginfold id='1'>
      Bob->Alice: Not so good :(
    <endfold id='1'>}</endfold id='1'> else <beginfold id='1'>{</beginfold id='1'>
      Bob->Alice: Feeling fresh like a daisy
    <endfold id='1'>}</endfold id='1'>

    opt <beginfold id='1'>{</beginfold id='1'>
      Bob->Alice: Thanks for asking
    <endfold id='1'>}</endfold id='1'>

    par <beginfold id='1'>{</beginfold id='1'>
      Alice->John: Hello guys!
    <endfold id='1'>}</endfold id='1'>
    
    try <beginfold id='1'>{</beginfold id='1'>
      Consumer->API: Book something
      API->BookingService: Start booking process
    <endfold id='1'>}</endfold id='1'> catch <beginfold id='1'>{</beginfold id='1'>
      API->Consumer: show failure
    <endfold id='1'>}</endfold id='1'> finally <beginfold id='1'>{</beginfold id='1'>
      API->BookingService: rollback status
    <endfold id='1'>}</endfold id='1'>
