From d0700298561999426a1c3abf1f91d82e684db47c Mon Sep 17 00:00:00 2001 From: Szymon Stasik Date: Sat, 12 Mar 2016 19:54:09 +0100 Subject: [PATCH] activations doc --- docs/content/sequenceDiagram.md | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/docs/content/sequenceDiagram.md b/docs/content/sequenceDiagram.md index 3da5d988a..8261456b3 100755 --- a/docs/content/sequenceDiagram.md +++ b/docs/content/sequenceDiagram.md @@ -72,6 +72,55 @@ There are six types of arrows currently supported: --x which will render a dotted line with a cross at the end (async) +## Activations +It is possible to activate and deactivate an actor. (de)activation can be dedicated declarations: + +``` +sequenceDiagram + Alice->>John: Hello John, how are you? + activate John + John-->>Alice: Great! + deactivate John +``` + +Renders to the diagram below: + +```mermaid +sequenceDiagram + Alice->>John: Hello John, how are you? + activate John + John-->>Alice: Great! + deactivate John +``` + +There is also a shortcut notation by appending `+`/`-` suffix to the message arrow: + +``` +sequenceDiagram + Alice->>+John: Hello John, how are you? + John-->>-Alice: Great! +``` + +Activations can be stacked for same actor: + +``` +sequenceDiagram + Alice->>+John: Hello John, how are you? + Alice->>+John: John, can yoy hear me? + John-->>-Alice: Hi Alice, I can hear you! + John-->>-Alice: I feel great! +``` + +Stacked activations look like this: + +```mermaid +sequenceDiagram + Alice->>+John: Hello John, how are you? + Alice->>+John: John, can yoy hear me? + John-->>-Alice: Hi Alice, I can hear you! + John-->>-Alice: I feel great! +``` + ## Notes It is possible to add notes to a sequence diagram. This is done by the notation Note [ right of | left of | over ] [Actor]: Text in note content