Activity Diagram: How to use custom style for decisions/diamonds

+1 vote
asked Feb 4, 2022 in Wanted features by simonste (120 points)

1 Answer

0 votes
answered Feb 4, 2022 by The-Lu (64,760 points)

Hello S.,

Stereotype seems to not be fully implemented; But a possible workaround is to use multiple style, as:

@startuml
title %version()
<style>
activityDiagram
{
 .r {
     BackgroundColor red
 }
 .g {
     BackgroundColor green
 }
diamond {
    BackgroundColor #red
  }
}
</style>
start
:A1;
if (<<r>>C1) then
  <<r>>:A2;
endif
<style>
activityDiagram {
  diamond {
    BackgroundColor #green
  }
}
</style>
while (<<g>><color:red>C2)
  <<g>>:A3;
endwhile
stop
@enduml

If that can  help,
Regards.

commented Feb 4, 2022 by simonste (120 points)
Thanks.
Seems not to work in 1.2022.0. But at least in the latest version.

It is a workaround, but when switching between styles it gets quite confusing.

Would be great to have this feature in an upcoming version.
...