Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to style a state in a PlantUML activity diagram (new syntax) for dashed or dotted outline

Tags:

uml

plantuml

Is it possible to use a dashed or dotted stroke to outline a state of an activity diagram using PlantUML?

Not using the new activity diagram syntax, we can do a state diagram with styled outline, ex.

state State1
state State2 ##[dashed]
State1 -[dashed]-> State2

State diagram with dashed outline

Is there a way to style the outline of a state using the new syntax? This does not work:

:State1;
-[dashed]->
:State2; ##[dashed]

Activity diagram without dashed outline

like image 494
GaspardP Avatar asked Sep 18 '25 11:09

GaspardP


1 Answers

State diagrams are not activity diagrams. A state is different than an activity.

That said, you can do this with the <style> feature in PlantUML (not super well documented):

@startuml
<style>
activityDiagram {
  .dashedStyle {
    LineStyle 4
  }
}
</style>
:State1;
-[dashed]->
:State2;<<dashedStyle>>
@enduml

Activity diagram with dashed outline of one activity

like image 172
Fuhrmanator Avatar answered Sep 23 '25 05:09

Fuhrmanator