Monday, 13 March 2023

PlantUML: customize the life line strategy in a sequence diagram

At the time of writing this post, there are two life line strategies supported by PlantUML.

 

solid: Put a solid life line in the sequence diagram.

nosolid: It is default one.

 

nosolidLifeline.txt

@startuml

skinparam lifelineStrategy nosolid

sys1 -> sys2: M1
sys1 <- sys2: M2
|||
sys1 -> sys2: M3
sys1 <- sys2: M4
||100||
sys1 -> sys2: M5

@endum

 

Above snippet generate below diagram.

 


 

solidLifeline.txt

@startuml

skinparam lifelineStrategy solid

sys1 -> sys2: M1
sys1 <- sys2: M2
|||
sys1 -> sys2: M3
sys1 <- sys2: M4
||100||
sys1 -> sys2: M5

@endum

 

There is an ongoing issue with solid lifeline, you can check below link.

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

 

There is alternative to get the solid behaviour using styles.

@startuml
<style>
lifeLine {
  LineStyle 0
}
</style>
sys1 -> sys2: M1
sys1 <- sys2: M2
sys1 -> sys2: M3
sys1 <- sys2: M4
sys1 -> sys2: M5

@enduml

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment