Order of announcement

0 votes
asked Jul 4, 2020 in Question / help by InExSu (140 points)

Hey!
Why does this code work:

@startuml
' Work
frame 01{
frame 02{
}
}
frame 01{
}
@enduml

and this one doesn't work.

@startuml
frame 01{
}
frame 02{
frame 01{
}
}
@enduml

It's supposed to work. I wonder why?

Thank you in advance.

1 Answer

+1 vote
answered Jul 4, 2020 by albert (3,520 points)

As far as  I can tell. The problem is that your frames don't have an explicit ID and thus the label is used as id and with the version that doesn't work you will have 2 frames with IDs 01 but on different levels. In the first example you also have 2 frames wit ID 01 but these are on the same level and seen as 1 frame.

The construct:

@startuml
frame 01{
}
frame 02{
frame 01 as C{
}
}
@enduml

does work.

The construct:

@startuml
frame 03{
frame 01{
}
}
frame 02{
frame 01{
}
}
@enduml

gives a bit a weird result as here only in frame 03 a frame 01 is seen when naming one of the 01 frames again frame 01 as C

a good / understandable result appears again.

@plantuml wouldn't it be better to have the default frame IDs to be 03, 03.01, 02 and 02.01 in this case?

commented Jul 4, 2020 by InExSu (140 points)
Thank you very much!
Your ID tip will help me!
...