Bug Report - State shows alias instead of long name when inside a composite AND when the state has an added attribute.

0 votes
asked Sep 21, 2021 in Bug by fergy-nz (140 points)

State shows alias instead of its long name when inside a composite and when the state has an added string attribute.

The problem exists in the version I'm using (v1.2021.7) and the current online version (v1.2021.11beta5)

The following demonstrates the issue. We can see that:

  • state1 renders correctly, showing both:
    • The long state name
    • The added string attribute
  • state2 renders correctly, showing only:
    • The long state name
    • There is no added string attribute
  • state3 renders incorrectly, we see:
    • The alias, instead of the long name
    • But the added string attribute is shown.
  • state 4 & state5 both only use short names and have no issues.

The code in question is shown here:

@startuml
state "State1 has a long name" as state1
state1: Has an attribute and\ncorrectly shows long name
state "Long Composite State" as composite {
  state "State2 has a long name" as state2
  state "State3 has a long name" as state3
  state state3: Adding an Attribute\nbreaks the long name\nand shows its alias instead
  state2 --> state3
||
  state state4
  state state5
  state5: An attribute
  state4 --> state5
}
@enduml

Thanks :-)

1 Answer

0 votes
answered Sep 21, 2021 by The-Lu (63,920 points)

Hello F.,

Suppress just the keyword state, before the definition of the attribute of the state3 (as state5), like:

@startuml
state "State1 has a long name" as state1
state1: Has an attribute and\ncorrectly shows long name
state "Long Composite State" as composite {
  state "State2 has a long name" as state2
  state "State3 has a long name" as state3
  state3: Adding an Attribute\nbreaks the long name\nand shows its alias instead
  state2 --> state3
||
  state state4
  state state5
  state5: An attribute
  state4 --> state5
}
@enduml

Then we observe the expected result:

If that can help,
Regards,
Th. 

commented Sep 21, 2021 by fergy-nz (140 points)
Thank you - cant believe how many times I went over that without seeing it.

My apologies, the bug was with me :-)
commented Sep 21, 2021 by The-Lu (63,920 points)

No problem; You are welcome.

And FYI: we have just added some info.  about alias on the doc. here:

...