Monday 13 February 2023

PlantUML: Add colour to the lifeline in a sequence diagram

We can apply colour to the lifeline in a sequence diagram.

 

Example

activate sys1 #lightgreen

 

Below snippet apply light green color to the sys1 lifeline.

 

lifeLineColor.txt

@startuml

title Job Scheduler

client -> sys1 : Submit the task
activate sys1 #lightgreen

sys1 -> sys2 : Submit the subtask t1 to sys2
activate sys2 #lightgreen

sys1 -> sys3 : Submit the subtask t2 to sys3
activate sys3 #lightgreen

sys2 -> sys4 : Submit the subtask t1.1 to sys4
activate sys4 #lightgreen
sys4 -> sys2 : Share the t1.1 task result
destroy sys4

sys3 -> sys1 : Share the t2 task result
deactivate sys3
 
deactivate sys2

sys1 -> client: Share the task result
deactivate sys1

@enduml

 

Above snippet generates below diagram.

 


 

  

Previous                                                    Next                                                    Home

No comments:

Post a Comment