|State diagrams are used to give an abstract description of the behavior of a system. This behavior is represented as a series of events that can occur in one or more possible states. You can use |
[*] for the starting point and ending point of the state diagram. Use
--> for arrows. You can use
hide empty description to render state as simple box. A state can also be composite. You have to define it using the
state keywords and brackets.
Sub-state to sub-state[Ref. QA-3300] You can also use the
state keyword to use long description for states.
You can use
[H] for the history and
[H*] for the deep history of a substate.
You can also fork and join using the
You can define concurrent state into a composite state using either
|| symbol as separator.
Vertical separator [Ref. QA-3086] The stereotype
<<choice>> can be used to use conditional state.
[Ref. QA-404, QA-1159 and GH-887] You can add point with
You can add pin with
<<outputPin>> stereotypes: [Ref. QA-4309] You can add expansion with
<<expansionOutput>> stereotypes: [Ref. QA-4309] You can use
-> for horizontal arrows. It is possible to force arrow's direction using the following syntax:
You can shorten the arrow definition by using only the first character of the direction (for example, Please note that you should not abuse this functionality : Graphviz gives usually good results without tweaking. You can change line color and/or line style. [Ref. Incubation: Change line color in state diagrams] You can also define notes using
-d- instead of
-down-) or the two first characters (
note left of,
note right of,
note top of,
note bottom of keywords. You can also define notes on several lines. You can also have floating notes. You can put notes on state-transition or link, with
note on link keyword.
You can put notes on composite states. [Ref. QA-1812] You can use the skinparam command to change colors and fonts for the drawing. You can use this command : You can define specific color and fonts for stereotyped states.
Test of all specific skinparam to State Diagrams
You can change style.
[Ref. GH-880] You can change the color or style of individual state using the following notation: With background color first (
#color), then line style and line color (
text:color seems not to be taken into account
FIXME[Adapted from QA-3770] With State you can use
alias, like: or:
Simple example[Ref. QA-17275] For another example, see on JSON page.
- Simple State
- Change state rendering
- Composite state
- Long name
- History [[H], [H\*]]
- Fork [fork, join]
- Concurrent state [--, \|\|]
- Conditional [choice]
- Stereotypes full example [start, choice, fork, join, end]
- Point [entryPoint, exitPoint]
- Pin [inputPin, outputPin]
- Expansion [expansionInput, expansionOutput]
- Arrow direction
- Change line color and style
- Note on link
- More in notes
- Inline color
- Changing style
- Change state color and style (inline style)
- Display JSON Data on State diagram