Activity diagrams: send signal

Activity diagrams: send signal

puml.online

简介 / 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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
@startuml
|发送方|
start
:校验请求;
-[#blue]-> SIG_VALIDATED : payload=ok;
detach
stop

|接收方|
start
:等待信号;
-> SIG_VALIDATED;
:处理结果;
stop
@enduml

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.
  • detach means the sender leaves the flow right after emitting the signal — the asynchronous semantic, often paired with fork.
  • |partition| places sender and receiver into different swimlanes (partitions).

Note: signal SIG; is not valid inside an activity diagram and fails with Syntax Error. The correct form is an arrow such as -> SIG;.

Mermaid 版

1
2
3
4
5
6
7
8
9
10
flowchart TD
subgraph SENDER["发送方"]
A[校验请求]
end
subgraph RECEIVER["接收方"]
B[等待信号]
C[处理结果]
end
A -. "SIG_VALIDATED : payload=ok" .-> B
B -. "SIG_VALIDATED" .-> C

Key points:

  • -. label .-> is a dashed arrow — the closest Mermaid equivalent to an asynchronous notification / signal.
  • A plain A --> B solid arrow means a synchronous data flow in Mermaid, which does not match signal semantics, so it is deliberately avoided here.
  • Mermaid has no detach keyword; asynchrony can only be conveyed by the drawing convention (the dashed line).
  • Mermaid’s subgraph is 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.