Default skinparam and actor,box, participant format for multiple diagrams in single file.

0 votes
asked Feb 27 in Question / help by Gauraiv Shettye
Dears,

I have multiple sequence diagrams in single file and using common skinparam, box, participant, actor for all diagrams.

If I separated diagrams with @startuml and @enduml then all skinparam, box, participant, actor need to be repeated under each diagram. How can I add repetition of declaration?

1 Answer

0 votes
answered Feb 27 by The-Lu (65,440 points)

Hello G.,

For that you can use definition, with `@startdef/@enddef` and identifier, see doc. here:

Regards,
Th.

commented Feb 28 by anonymous

Tried below code but not able to get expected image.

Code


@startdef (id=ggs)
    skinparam MaxMessageSize 400
    skinparam BoxPadding 10
   
    skinparam ArrowFontColor #003366
    skinparam ArrowFontSize 20
 
    skinparam NoteFontSize 18
    skinparam NoteFontColor #0000
    skinparam NoteBackgroundColor #E12E56
    skinparam NoteShadowing false
    skinparam NoteTextAlignment left
 
    skinparam ActorBackgroundColor #0069B1
    skinparam ActorBorderColor #E12E56
    skinparam Participant{
        FontColor #FFFFFF
        BackgroundColor #0069B1
        Padding 10
        FontSize 18
       
    }
    participant "Customer Mobile App" as A #BF9000
    participant "Customer Mobile Backend" as B #ED7D31
@enddef

@startuml
!includedef ggs

A -> B: Text
B -> A: Return
@enduml


Image received:

image

Expected Image:

image

commented Feb 28 by The-Lu (65,440 points)

Hi G., and A.,

To see the expected result:

  • Could you just suppress the space between `@startdef` and `(id=ggs)`?

from:

@startdef (id=ggs)

to:

@startdef(id=ggs)

Otherwise use 'sub' or 'include'...

Enjoy, wink
Regards,
Th.

...