Messages and fragments

Describe calls, returns, lifecycles, and alternative paths in event order.

AAL Sequence 0.1 · Dictionary 0.1.0

On this page

Messages, activations, and lifecycles

MessageMeaning and appearance
syncSynchronous call; filled arrowhead.
asyncAsynchronous message; open arrowhead.
returnReturn message; dashed line and open arrowhead.
createIntroduces the destination at its first header.
destroyEnds the destination lifeline with a termination marker.
Optional message protocol
message Request Portal -> Auth sync "Validate credentials" { protocol "HTTPS" }

Equal endpoints produce a self-message for sync, async, or return. Create/destroy require distinct endpoints. A participant introduced by create is unavailable before creation, and cannot receive messages after destruction.

Activation spans are explicit: activate Work Api starts a span, and deactivate Done Work closes it. Close nested activations in reverse order. Adding an activation span creates both events; Reveal in source helps place its closing event around the intended work.

Worker lifecycle and status detail
ClientactorJobs APIapiJob workerserviceSubmit jobStart workerProcess inputResult readyRelease workerJob completeCheck completion status

The worker begins at Start worker and ends at Release worker. Toggle bottom headers: surviving Client and API repeat; the destroyed Worker does not. Show all also reveals the status detail owned by Check completion status. Scroll inside the diagram to see its full size. These previews use the editor’s actual layout and SVG renderer.

Read the complete AAL
Worker lifecycle and status detail
aal sequence "0.1" dictionary "0.1.0"
interaction Jobs "Background job" {
    participant Client "Client" { type actor }
    participant Api "Jobs API" { type api icon "/deployment-icons/generic/integration.svg" }
    participant Worker "Job worker" { type service }
    sequence Run "Create and complete a job" {
        participants [Client, Api, Worker]
        message Submit Client -> Api sync "Submit job"
        message Spawn Api -> Worker create "Start worker"
        activate Work Worker
        message Process Worker -> Worker sync "Process input"
        message Result Worker -> Api return "Result ready"
        deactivate Done Work
        message Stop Api -> Worker destroy "Release worker"
        message Respond Api -> Client return "Job complete"
        message Check Client -> Api sync "Check completion status" { detail Status }
    }
    sequence Status "Check status" {
        participants [Client, Api]
        message Query Client -> Api sync "Read job status"
        note Cached right [Api] "Status is cached independently of the worker"
        message Reply Api -> Client return "Completed"
    }
}

Fragments, guards, notes, and references

ConstructAuthoring rule
alt / elseGuarded alternatives, with optional final else.
optOne optional branch.
loopOne repeated branch; preserve its entry lifetime state.
parAt least two parallel branches without conflicting lifecycle changes.
criticalOne branch describing exclusive work.
breakOne conditional exit; later events describe the non-breaking path.
noteBeside one participant, or over one or more participants.
refA named interaction frame, without a navigation link.

Guards describe conditions; they are not executable expressions. Branch activation pairs must close within their branch. Continuing alternatives must agree on lifetimes; optional and break branches preserve entry state. Fragment nesting is independent of L1–L3 hierarchy depth.

Select a fragment to edit its guard labels, add an alt/par branch, or remove a branch. Select an event and use Move into branch to choose a readable destination. Invalid moves are rejected without changing the diagram.

Checkout execution constructs
alt Validate basket[basket valid][else]par Independent work[audit][metrics]opt Receipt[requested]loop Retry delivery[up to three attempts]critical Finalize[exclusive]break Stop on cancellation[cancelled]BuyeractorCheckout APIapiOrder EventsqueuePlace orderOrder placedValidation errorsAuditCount orderRetry pending eventFinalize orderOrder confirmedAsynchronous deliveryrefSend receiptInteraction ends here when cancelled

Follow the branch compartments to distinguish alternatives, parallel work, optional receipts, retries, exclusive work, and cancellation. Scroll to see the complete sequence. Scroll inside the diagram to see its full size. These previews use the editor’s actual layout and SVG renderer.

Read the complete AAL
Checkout execution constructs
aal sequence "0.1" dictionary "0.1.0"
interaction Checkout "Checkout" {
    participant Buyer "Buyer" { type actor }
    participant Api "Checkout API" { type api }
    participant Events "Order Events" { type queue }
    sequence Order "Place an order" {
        participants [Buyer, Api, Events]
        message Place Buyer -> Api sync "Place order"
        activate Processing Api
        fragment Validation alt "Validate basket" {
            branch Valid "basket valid" {
                message Publish Api -> Events async "Order placed"
                note Delivery over [Api, Events] "Asynchronous delivery"
            }
            else Invalid { message Reject Api -> Buyer return "Validation errors" }
        }
        fragment Work par "Independent work" {
            branch Audit "audit" { message AuditEvent Api -> Events async "Audit" }
            branch Metrics "metrics" { message Count Api -> Api sync "Count order" }
        }
        fragment Optional opt "Receipt" { branch Requested "requested" { ref Receipt [Api, Buyer] "Send receipt" } }
        fragment Retry loop "Retry delivery" { branch Attempts "up to three attempts" { message RetryEvent Api -> Events async "Retry pending event" } }
        fragment Exclusive critical "Finalize" { branch Lock "exclusive" { message Finalize Api -> Api sync "Finalize order" } }
        deactivate Finished Processing
        fragment Exit break "Stop on cancellation" { branch Cancelled "cancelled" { note Stop over [Buyer, Api] "Interaction ends here when cancelled" } }
        message Complete Api -> Buyer return "Order confirmed"
    }
}