Composite state functionality with allow_mixing

0 votes
asked Jan 13, 2023 in Question / help by Vantage0542 (120 points)

I'm trying to use composite state functionality with allow_mixing and running into some issues. It appears that you cannot use composite states and allow_mixing at the same time.

For example,

@startuml

state "A" as stateA {
    state B
}
@enduml

Renders without issue.

However,

@startuml
allow_mixing

state "A" as stateA {
 state B
}
@enduml

Gives a syntax error on line "state "A" as stateA {"

Additionally,

@startuml
allow_mixing

state "A" as stateA
@enduml

Renders without issue.

For context, I am trying to insert a table of conditions/information into a state or conditional of a state diagram. To achieve this, I am trying to mix json data into the diagram, but running into the issue above.

Is there a way to get allow_mixing to work with composite states? Or perhaps I am approaching the way I want to achieve a table/json data inside a state incorrectly?

1 Answer

+1 vote
answered Jan 13, 2023 by plantuml (294,960 points)
selected Jan 20, 2023 by Vantage0542
 
Best answer

You can now have this with last snapshot:

@startuml
state "A" as stateA
state "C" as stateC {
 state B
}
json foo1 {
  "foo2": "foo3"
}
@enduml

Hope this helps!

commented Jan 20, 2023 by Vantage0542 (120 points)
Thank you, that has solved what I was trying to do!
...