Document <<choice>> in the state diagram page

This commit is contained in:
José Duarte 2021-05-14 13:21:03 +01:00 committed by GitHub
parent ac837a77e7
commit a4795975a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,6 +228,28 @@ stateDiagram-v2
*You can not define transitions between internal states belonging to different composite states*
## Choice
Sometimes you need to model a choice between two or more paths, you can do so using &lt;&lt;choice&gt;&gt;.
```
stateDiagram-v2
state if_state <<choice>>
[*] --> IsPositive
IsPositive --> if_state
if_state --> False: if n < 0
if_state --> True : if n >= 0
```
```mermaid
stateDiagram-v2
state if_state <<choice>>
[*] --> IsPositive
IsPositive --> if_state
if_state --> False: if n < 0
if_state --> True : if n >= 0
```
## Forks
It is possible to specify a fork in the diagram using &lt;&lt;fork&gt;&gt; &lt;&lt;join&gt;&gt;.