Hide complex state decomposition / reuse state machines

0 votes
asked Jan 7, 2022 in Wanted features by remram44 (120 points)

I have multiple identical complex states.

First, to do this, I need to show a state that is complex but with its decomposition hidden, like this:

I didn't find a way to do this with PlantUML. I am currently using the text description.

Secondly, I would like to show the exitpoint of that machine. However putting exitpoints on a state make it complex, and unreasonably large; in addition the exitpoints tend to overlap:

@startuml
[*] --> MainPhase
state MainPhase {
    state "ready" as main_ready <<exitpoint>>
    state "other" as main_other <<exitpoint>>
}
main_ready --> DrawPhase
DrawPhase --> AttackPhase
MainPhase : internal machine
AttackPhase : internal machine
state AttackPhase {
    state "ready" as attack_ready <<exitpoint>>
    state "other" as attack_other <<exitpoint>>
}
attack_ready --> [*]

state "internal machine" as _Internal {
    [*] --> A
    A --> B
}
@enduml

Example overlapping exitpoints in nested states:

1 Answer

+1 vote
answered Jan 10, 2022 by Serge Wenger Work (15,620 points)

Hello, for the first question, you can use sprite. I create a dummy sample to show the principle (click on the image to show the code:

Hope this helps

commented Jan 10, 2022 by remram44 (120 points)

Thanks, that helps a lot! I adapted it into this: https://www.plantuml.com/plantuml/uml/jL71QeKm4BplL-oXfuBKLF1GYdWeXPuzgWVH1GCcXhZIYlZlZT5A2U_utXoMoUomWPbyuiRoh0RePKT8ol227KsjbORbgC7jcR1WCWAcVlo-PJ5MEi_JnwpKWgL8VqJw8j8QLuW3t4VutB7JWu3diPid-HCSBY5mX3V2NnuaR00-Idn3gPciRWPKJTjBJPMk-Ft8C3jDKPJvv5_1p-kT_6ibmHKGo-VQRx_EeuLhIiC6EUdEbViB

Now if I could find a way to fix the positions of the exitpoints... I am currently generating SVG and moving them manually, which is not ideal.

commented Jan 11, 2022 by Serge Wenger Work (15,620 points)
Dear PlantUML team,

Could you do something?
...