"allowmixing" has side-effect on remove

0 votes
asked Mar 8 in Bug by DrMarkusVoss (160 points)

When "allowmixing" is set on a diagram, then the "remove" command does not work on nested elements.

With PlantUML v1.2022.6 it worked, I haven't tested versions in between.

Example:

@startuml

' toggle allowmixing on/off to see
' the side-effect.
allowmixing

node "huhu" as huhu {

rectangle "trara" as trara

}

' when allowmixing is on, then the remove
' command on the nested element has no
' effect.
remove trara

@enduml

commented Mar 8 by DrMarkusVoss (160 points)
btw. the same problem with the "hide" command...

3 Answers

0 votes
answered Mar 10 by The-Lu (79,040 points)
selected Mar 10 by DrMarkusVoss
 
Best answer

Hello D.,

Same answer as:

If you use `allowmixing` and potentially class and namespace...

To remove/hide, you must use:

  • set separator none
  • or explicitly the full namespace, like `remove huhu.trara`
Enjoy,
Regards,
Th.
0 votes
answered Mar 8 by DrMarkusVoss (160 points)

Even if not using "allowmixing", the following code creates a valid diagram (although it should not be possible to mix components and classes (same with object)...

So it seems to be a problem that occurs when mixing class (obj) elements with other (e.g. component) elements onto one diagram which should raise an error I guess, but renders, but then creates a problem with remove and hide...

When introducing "allowmixing" it would be valid to mix these elements, but still the problem with remove and hide remains...

@startuml

component "huhu" as huhu {

class "trara" as trara

}

remove trara

@enduml

commented Mar 10 by The-Lu (79,040 points)

Hello D.,

That is normal, due to namespace management...

With new version of Plantuml, If you must remove trara, you must use either:

@startuml
component "huhu" as huhu {
  class "trara" as trara
}
remove huhu.trara
@enduml

Either:

@startuml
set separator none
component "huhu" as huhu {
  class "trara" as trara
}
remove trara
@enduml

Enjoy,
Regards,
Th.

commented Mar 10 by DrMarkusVoss (160 points)
Thanks, that's it!
commented Mar 10 by anonymous
I wrote something wrong here before, seems I cannot delete it so I changed it to this...
0 votes
answered Mar 10 by anonymous

It seems it is already worked on for a longer time, unfortunately not yet solved...

https://github.com/plantuml/plantuml/issues/1769

...