Tuesday, 30 January 2024

PlantUML: History state in uml diagram

History state is shown by a circle with an H inside it. When a transition  leads to a history state, instead of history state becomes active, the “most recently visited state” becomes active.

historyState.txt

@startuml

left to right direction

state "power off" as off #pink

state running #palegreen{
	state washing 
	state rinsing
	state spinning

        off --> [H] : restore power
}


[*] --> washing : start
washing --> rinsing
rinsing --> spinning
running --> off : power cut
running --> [*] : stop

@enduml

 

Above snippet generate below diagram.


  

Previous                                                    Next                                                    Home

No comments:

Post a Comment