[State Diagram] History pseudo-states

0 votes
asked Sep 17, 2018 in Wanted features by edobez (140 points)

Is it already possible to draw pseudo-states like Deep and Shallow history on State Diagrams?

This would be a nice feature to get closer to the UML specification.


commented Sep 18, 2018 by edobez (140 points)
I later found that this is strictly related to question http://forum.plantuml.net/1665/history-pseudostate. It hasn't been answered though.

2 Answers

0 votes
answered Sep 17, 2018 by Artrax
You can use [H], but this state is not accessible from the outside of a state.

state example {

[H] --> Some


Other --> [H] 'Would be another state'
commented Sep 18, 2018 by edobez (140 points)
Thank you, this is something but it doesn't solve my problem since as you said you can't target the History pseudo-state from outside. This is a common state pattern named "Transition to History".
commented Sep 19, 2018 by Artrax
I know, but what you want to do is not possible with plantuml
+1 vote
answered Jan 22 by Frédéric Guérin

This is not be a perfect solution...


hide empty description
skinparam shadowing false

skinparam state<<history>> {
    backgroundColor transparent
    borderColor transparent
    fontSize 30

title History Demo
[*] --> Closed
Open --> Closed

state Open {
    [*] -r-> Red
    Red -r-> Green
    Green --> Yellow
    Yellow --> Red
    state "Ⓗ" as H<<history>>
    Closed --> H


As you can see below, a residual problem is that the arrow to the history state stops short of reaching to it!