Sunday 28 January 2024

PlantUML: Composite state in state diagram

A state can be composite (State can hold multiple other states).

compositeState.txt

@startuml

state compositeState1 {
	state subState1 {
		state s1
		state s2
	}
	state subState2
}

state state2

[*] --> compositeState1
s1 --> s2
s1 --> state2
subState2 --> subState1
state2 --> [*]

@enduml

 

Above snippet generate below diagram.

  

Previous                                                    Next                                                    Home

No comments:

Post a Comment