Activity diagrams: send signal
简介 / Introduction
In UML activity diagrams, a signal represents an asynchronous, broadcastable event notification: the sender emits the signal and immediately continues its own flow without waiting for a reply; the receiver captures the signal later and reacts. That is the difference from a call — there is no synchronous return arrow.
PlantUML emits a signal directly with -> SIGNAL_NAME;. Mermaid has no first-class signal concept, so it can only be approximated with a dashed arrow plus a label. Below, the same flow — validate a request → broadcast a validation result signal → receiver handles it — is implemented in both engines.
PlantUML 版
1 | @startuml |
Key points:
-> SIG_VALIDATED;is a send-signal edge; the label is drawn next to the arrow.-[#blue]-> SIG_VALIDATED : payload=ok;adds a color and a payload description to the signal.detachmeans the sender leaves the flow right after emitting the signal — the asynchronous semantic, often paired withfork.|partition|places sender and receiver into different swimlanes (partitions).
Note:
signal SIG;is not valid inside an activity diagram and fails withSyntax Error. The correct form is an arrow such as-> SIG;.
Mermaid 版
1 | flowchart TD |
Key points:
-. label .->is a dashed arrow — the closest Mermaid equivalent to an asynchronous notification / signal.- A plain
A --> Bsolid arrow means a synchronous data flow in Mermaid, which does not match signal semantics, so it is deliberately avoided here. - Mermaid has no
detachkeyword; asynchrony can only be conveyed by the drawing convention (the dashed line). - Mermaid’s
subgraphis a grouping box, not a UML swimlane: there is no horizontal separator, so it reads more like a “container”.
对比 / Side-by-side
| Feature | PlantUML | Mermaid |
|---|---|---|
| Send-signal syntax | -> SIG_NAME; (label + color supported) |
No native syntax; emulated with -. label .-> |
| Asynchronous semantics | Expressible via detach / swimlanes |
Convention only, via the dashed line |
| Receiving a signal | Also -> SIG; form (object receivers need a lane/object qualifier) |
No counterpart concept |
| Grouping | ` | partition |
| Rendering engine | UML activity diagram | Generic flowchart |
小结 / Wrap-up
PlantUML’s -> SIG; is a genuine UML signal: semantically precise, with label and color support, which makes it the right choice for formal modeling documents. Mermaid can only approximate a signal with a dashed arrow, but it renders everywhere Mermaid is supported. Both are readable when sketching an event flow across services, but if strict UML semantics matter, pick PlantUML.
- Title: Activity diagrams: send signal
- Author: puml.online
- Created at : 2026-11-27 09:00:00
- Updated at : 2026-12-05 02:08:58
- Link: https://puml.online/blog/activity-diagram-send-signal-en/
- License: This work is licensed under CC BY-NC-SA 4.0.