ZenUML uses experimental lazy loading and async rendering features which may change in future versions.
Basic sequence diagram
This example shows a simple conversation between Alice and John:Participants
Implicit declaration
Participants are automatically created when first used in the diagram:Explicit declaration
You can control the order of participants by declaring them explicitly:Annotators
Use annotators to display participants as specific symbols:Available annotators
Available annotators
ZenUML supports various annotator types including:
@Actor- Human actor@Database- Database system@Boundary- System boundary@Control- Control element@Entity- Entity@Queue- Message queue
Aliases
Create shorter identifiers with descriptive labels:Messages
ZenUML supports four types of messages:Sync messages
Synchronous (blocking) method calls:Async messages
Asynchronous (non-blocking) messages:Creation messages
Create new objects using thenew keyword:
Reply messages
There are three ways to express replies:Early return example
The@return annotator is useful for returning to one level up:
Nesting
Sync and creation messages support nesting with curly braces:Comments
Add comments using// syntax. Comments are rendered above messages and support Markdown:
Loops
Create loops usingwhile, for, forEach, or loop:
Loop syntax
Alternative paths
Express conditional logic withif/else:
Alt syntax
Optional fragments
Render optional fragments withopt:
Parallel execution
Show actions happening in parallel:Parallel syntax
Try/catch/finally
Model exception handling and breaks in sequence flow:Exception syntax
Complete example
Here’s a comprehensive example showing various ZenUML features:Integration with web pages
Using ZenUML in HTML
Using ZenUML in HTML
To use ZenUML diagrams in a web page:
While ZenUML and standard Mermaid sequence diagrams produce similar visual results, they use different syntax. Choose the one that best fits your workflow.