Conditional Application of Styles

0 votes
asked Jul 30 in Question / help by kjw

Have been digging into the styles wiki http://wiki.plantuml.net/site/style-evolution and looking to apply a style in a function. There doesn't seem to be a way to activate the style. Any suggestions?

@startuml

skinparam useBetaStyle true
!function formatConnection($sequenceArrowThickness, $from, $to, $protocol)
   style message {
        SequenceArrowThickness $sequenceArrowThickness
    }
   '$from<<-[thickness=$sequenceArrowThickness]->>$to <style : SequenceArrowThickness= $sequenceArrowThickness> : $protocol
   $from<<->>$to : $protocol
!endfunction

box "AWS " #LightBlue
    participant "aPlatform" as ap
    
end box
box "External" #Lightgreen
    participant "External API" as extapi
    participant "External  Service" as exts
end box

formatConnection("5", "ap", "extapi","<< MA-TLS >>")

@enduml

1 Answer

0 votes
answered Jul 30 by plantuml (208,860 points)

Well, style implementation is really in progress. So do not expect to much from it yet.

We've just implemented message/arrow thickness in last beta http://beta.plantuml.net/plantuml.jar

Your example should be read as is :

@startuml

skinparam useBetaStyle true
!function formatConnection($sequenceArrowThickness, $from, $to, $protocol)
style arrow {
  LineThickness $sequenceArrowThickness
}
  $from<<->>$to : $protocol
!endfunction

box "AWS " #LightBlue
    participant "aPlatform" as ap
   
end box
box "External" #Lightgreen
    participant "External API" as extapi
    participant "External  Service" as exts
end box

formatConnection("5", "ap", "extapi","<< MA-TLS >>")

@enduml
commented Jul 31 by kjw
Thanks but the style doesn't get applied - just getting the default thickness
...