History pseudostate

+5 votes
asked Mar 3, 2014 in Wanted features by anonymous

Pseudo-states are be supported using the following syntax:

state choiceState <<choice>>

state en1 <<entrypoint>>

but there doesn't seem to be any support for shallow and deep history pseudo-states. Shallow history should be a "H" character in a circle and deep history by "H*" in a circle. It should be possible for a history pseudo-state to be the target of transitions (while nested inside a super-state) and it should be possible to set a transition from the history state to whatever the default state is. See the diagram below:

  @startuml
  state Comp {
      state en1 <<entrypoint>>
      [*] --> A
      A --> B
      B --> C
      C --> [*]
      en1 --> History
      History --> A
  }
  
  [*] --> en1
  @enduml
 
It seems the only way to target the sub-state is to use the entrypoint, if it is targeted directly it gets pulled out of the composite state (bug?).

1 Answer

0 votes
answered Oct 23 by The-Lu (74,900 points)

Hi A.,

To answer a very old question... wink

That is now possible (History and Deep history are now implemented on state diagram).

From:

We can now use:

  @startuml
  state Comp {
      state en1 <<entrypoint>>
      [*] --> A
      A --> B
      B --> C
      C --> [*]
      en1 --> [H]
      [H] --> A
  }
  
  [*] --> en1
  @enduml

Or:

  @startuml
  state Comp {
      [*] --> A
      A --> B
      B --> C
      C --> [*]
      [H] --> A
  }
  [*] --> Comp[H]
  @enduml

Enjoy,
Regards,
Th.

...