IllegalStateException while attempting to rename nested state

0 votes
asked Feb 11 in Bug by Tomáš Vavro

I am not certain, this is a bug, but the compiler thinks so, hence this post.

Actual behavior

With the following code:

@startuml
hide empty description 

state state1.idle as "This is the idle state"
state state1.over
state1.idle --> state1.over

@enduml

I get the correct result (the display name of the state state1.idle is changed):

image

However with the following code:

@startuml
hide empty description 

state state1 as "Toplevel state"
state state1.idle as "This is the idle state"
state state1.over
state1.idle --> state1.over

@enduml

I get the following exception:

image

Expected behavior

I would expect the result to be akin to the following:

@startuml
hide empty description 

state state1 as "Toplevel state" {
    state idle as "This is the idle state"
    state over
    idle --> over
}

@enduml

image


I am not entirely sure this is a bug, this may very well be misuse of the namespace syntax.

1 Answer

0 votes
answered Feb 11 by The-Lu (88,340 points)
 
Best answer

Hello T.,

Here is the right syntax:

@startuml
hide empty description 

state "Toplevel state" as state1 {
state "This is the idle state" as idle
}
state state1.over
state1.idle --> state1.over

@enduml

Regards,
Th.

commented Feb 11 by The-Lu (88,340 points)

Or:

@startuml
hide empty description 

state state1.idle as "This is the idle state"
state state1.over
state1.idle --> state1.over

state state1 as "Toplevel state"
@enduml
...