How can I workaround numerical <style> wrapper limit?

0 votes
asked May 13 in Question / help by rtilleryweb (120 points)
edited May 13 by rtilleryweb

Based on this question, I added style to my arrows using a stereotype. However, this does not appear to work for short arrows:

@startuml
<style>
.a {
  LineThickness 3
  Linecolor red
}
</style>
participant alice
alice -> bob : msg
alice ->x? <<a>> : red
@enduml

PlantUML Server

PlantUML error

To format short arrows, I used the style workaround mentioned for LineStyle in the checked answer of the above question. I also used this for other places where the formatting doesn't work for stereotypes or inline (e.g. certain group format parameters). However, I have run into an issue with this now: After using it in the same diagram for a while, it stops working.

(Note that I am creating rather complicated diagrams. Although I have broken them up, I was asked to provide a single combined diagram as well, which is where this occurs.)

After a couple hundred of these <style></style> changes, things break. (On the PlantUML server, the default size of the render images appears to be being used, so you can't see it there. But you can see it at the bottom of the rendered SVG version.)

@startuml
<style>
.a {
  LineThickness 5
  LineColor green
}
</style>

!procedure $LineSets($num)

  !while $num > 0
    alice -> bob <<a>> : msg

    <style>
      arrow {
      LineThickness 3
      Linecolor red
    }
    </style>

    alice ->x? : red

    <style>
    arrow {
      LineThickness 1
      Linecolor black
    }
    </style>

       !$num = $num - 1
  !endwhile
!endprocedure

$LineSets(300)
@enduml

Note that the style workaround (red) isn't what is failing, but this set/reset cycle ends up breaking the <<a>> (green) stereotype. Oddly, in my large diagrams, other stereotypes/css styles do not seem to be affected--only the ones used for arrows. I found this out when I tried replicating the arrow stereotype with a different name, but it also fails.

Without breaking up the diagram (explained above), how can I work around this? (Will I need to modify all arrows to use this set/reset cycle?)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...