Add capability to nest state diagrams in package or frame

0 votes
asked Jan 25 in Wanted features by Bob Cavanaugh
It would make my drawings easier to integrate with SYSML requirements if I could do something like the following:

@startuml

frame "state_machine" {

    state foo

    state bar

    [*] -> foo

    foo -> bar

}

@enduml

Frame or package would meet the request

Thanks!

3 Answers

0 votes
answered Jan 25 by The-Lu (49,760 points)

Hello B.,

A possible workaround is to use sub-diagram and label, as:

@startuml
frame  "state_machine" {
label l [
{{
    state foo
    state bar
    [*] -> foo
    foo -> bar
}}
]
}
@enduml

Or simply `mainframe`, as:

@startuml
mainframe  "state_machine"
state foo
state bar
[*] -> foo
foo -> bar
@enduml

If that can help,
Regards,
Th.

0 votes
answered Jan 26 by plantuml (279,680 points)

You can also simply have:

@startuml
state state_machine {
    state foo
    state bar
    [*] --> foo
    foo --> bar
}
@enduml

Does it help?

0 votes
answered Jan 26 by plantuml (279,680 points)

With last snapshot, you can have this:

Does it sound good?

...