Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 80 additions & 3 deletions C4/C4.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
' ##################################
!function C4Version()
' 2 spaces and ' are used as unique marker, that the release scripts makes the correct version update
!$c4Version = "2.6.0"
!$c4Version = "2.7.0"
!return $c4Version
!end function

Expand Down Expand Up @@ -132,6 +132,10 @@ skinparam queue {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}

skinparam participant {
StereotypeFontSize $STEREOTYPE_FONT_SIZE
}

skinparam arrow {
Color $ARROW_COLOR
FontColor $ARROW_FONT_COLOR
Expand Down Expand Up @@ -353,6 +357,9 @@ skinparam package {
!$tagSkin = $tagSkin + $elementTagSkinparams("person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "")
' actor has style awesome, therefore $fontColor is ignored and text uses $bgColor too
!$tagSkin = $tagSkin + $elementTagSkinparams("actor", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "")
' sequence requires participant
!$tagSkin = $tagSkin + $elementTagSkinparams("participant", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "")
!$tagSkin = $tagSkin + $elementTagSkinparams("sequencebox", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "")
!if (%strpos($tagStereo, "boundary") >= 0 && $bgColor != "")
!$tagSkin = $tagSkin + "skinparam package<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline()
!$tagSkin = $tagSkin + "skinparam rectangle<<" + $tagStereo + ">>StereotypeFontColor " + $bgColor + %newline()
Expand Down Expand Up @@ -893,8 +900,16 @@ $elementSkin
!if (%strpos($text, "\n") >= 0)
!while (%strpos($text, "\n") >= 0)
!$brPos = %strpos($text, "\n")
!$multiLine = $multiLine + %substr($text, 0, $brPos) + $usedNewLine
!if ($brPos > 0)
!$multiLine = $multiLine + %substr($text, 0, $brPos) + $usedNewLine
!else
' <U+00A0> non breaking change that newLine breaks with formats can be used with \n\n
!$multiLine = $multiLine + "<U+00A0>" + $usedNewLine
!endif
!$text = %substr($text, $brPos+2)
!if (%strlen($text) == 0)
!$text = "<U+00A0>"
!endif
!endwhile
!else
!while ($width>0 && %strlen($text) > $width)
Expand Down Expand Up @@ -965,6 +980,17 @@ $elementSkin
!return $element
!endfunction

!function $getElementLine($umlShape, $elementType, $alias, $label, $techn, $descr, $sprite, $tags, $link)
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", $elementType)
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", $elementType)
!$baseProp = $getElementBase($label, $techn, $descr, $sprite) + $getProps()
!$stereo = $toStereos($elementType,$tags)
!$calcLink = $getLink($link)

!$line = $umlShape + " " + %chr(34) + $baseProp + %chr(34) +" " + $stereo + " as " + $alias + $calcLink
!return $line
!endfunction

' Element properties
' ##################################

Expand Down Expand Up @@ -1267,6 +1293,57 @@ rectangle "$getBoundary($label, $type)" $toStereos("boundary", $boundaryTags) as
' Boundary Styling
UpdateBoundaryStyle("", $bgColor=$BOUNDARY_BG_COLOR, $fontColor=$BOUNDARY_COLOR, $borderColor=$BOUNDARY_COLOR)

' Index
' ##################################

' Dynamic/Sequence diagram supports (automatically) numbered interactions:
' preferred function calls
' (Uppercase) LastIndex(): return the last used index (function which can be used as argument)
' (Uppercase) Index($offset=1): returns current index and calculates next index (function which can be used as argument)
' (Uppercase) SetIndex($new_index): returns new set index and calculates next index (function which can be used as argument)

' old procedures calls
' (lowercase) increment($offset=1): increase current index (procedure which has no direct output)
' (lowercase) setIndex($new_index): set the new index (procedure which has no direct output)

!$lastIndex = 0
!$index = 1

!procedure increment($offset=1)
!$lastIndex = $index
!$index = $index + $offset
!endprocedure

!procedure setIndex($new_index)
!$lastIndex = $index
!$index = $new_index
!endprocedure

!function Index($offset=1)
!$lastIndex = $index
!$index = $lastIndex + $offset
!return $lastIndex
!endfunction

!function LastIndex()
!return $lastIndex
!endfunction

!function SetIndex($new_index, $offset=1)
!$lastIndex = $new_index
!$index = $new_index + $offset
!return $lastIndex
!endfunction

!unquoted function $getPrefix($index)
!if ($index == "")
!$pre = Index() + ": "
!else
!$pre = $index + ": "
!endif
!return $pre
!endfunction

' Relationship
' ##################################

Expand Down Expand Up @@ -1438,7 +1515,7 @@ $from -[hidden]L- $to
!endprocedure

' PlantUML bug: lines which does "not match" with the orientation/direction of the diagram
' uses the same length therefore the method offers no direction at all.
' use the same length therefore the method offers no direction at all.
' If a direction is required the Lay_...() methods can be used
!unquoted procedure Lay_Distance($from, $to, $distance="0")
$from $getHiddenLine($distance) $to
Expand Down
28 changes: 6 additions & 22 deletions C4/C4_Component.puml
Original file line number Diff line number Diff line change
Expand Up @@ -53,42 +53,26 @@ endlegend
' Elements
' ##################################

!function $getComponent($label, $techn, $descr, $sprite)
!return $getElementBase($label, $techn, $descr, $sprite)
!endfunction

!unquoted procedure Component($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "component")
rectangle "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("component",$tags) as $alias $getLink($link)
$getElementLine("rectangle", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "component")
database "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("component",$tags) as $alias $getLink($link)
$getElementLine("database", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "component")
queue "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("component",$tags) as $alias $getLink($link)
$getElementLine("queue", "component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Component_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_component")
rectangle "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_component",$tags) as $alias $getLink($link)
$getElementLine("rectangle", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_component")
database "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_component",$tags) as $alias $getLink($link)
$getElementLine("database", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ComponentQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_component")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_component")
queue "$getComponent($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_component",$tags) as $alias $getLink($link)
$getElementLine("queue", "external_component", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
28 changes: 6 additions & 22 deletions C4/C4_Container.puml
Original file line number Diff line number Diff line change
Expand Up @@ -60,44 +60,28 @@ endlegend
' Elements
' ##################################

!function $getContainer($label, $techn, $descr, $sprite)
!return $getElementBase($label, $techn, $descr, $sprite)
!endfunction

!unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "container")
rectangle "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("container", $tags) as $alias $getLink($link)
$getElementLine("rectangle", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "container")
database "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("container", $tags) as $alias $getLink($link)
$getElementLine("database", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "container")
queue "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("container", $tags) as $alias $getLink($link)
$getElementLine("queue", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_container")
rectangle "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_container", $tags) as $alias $getLink($link)
$getElementLine("rectangle", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_container")
database "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_container", $tags) as $alias $getLink($link)
$getElementLine("database", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure ContainerQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_container")
!$techn=$toElementArg($techn, $tags, "ElementTagTechn", "external_container")
queue "$getContainer($label, $techn, $descr, $sprite)$getProps()" $toStereos("external_container", $tags) as $alias $getLink($link)
$getElementLine("queue", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure

' Boundaries
Expand Down
46 changes: 15 additions & 31 deletions C4/C4_Context.puml
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,6 @@ UpdateElementStyle("external_person")
!return $getElementBase($label, $type, $descr, $sprite)
!endfunction

!function $getSystem($label, $type, $descr, $sprite)
!return $getElementBase($label, $type, $descr, $sprite)
!endfunction

!unquoted procedure Person($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "person")
' $type reuses $techn definition of $tags
Expand Down Expand Up @@ -380,45 +376,33 @@ rectangle "$getPerson($label, $type, $descr, $sprite)$getProps()" $toStereos("ex
!endprocedure

!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "system")
rectangle "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("system", $tags) as $alias $getLink($link)
!endprocedure

!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "external_system")
rectangle "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("external_system", $tags) as $alias $getLink($link)
' $type reuses $techn definition of $tags
$getElementLine("rectangle", "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemDb($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "system")
database "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("system", $tags) as $alias $getLink($link)
' $type reuses $techn definition of $tags
$getElementLine("database", "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemQueue($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "system")
queue "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("system", $tags) as $alias $getLink($link)
' $type reuses $techn definition of $tags
$getElementLine("queue", "system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
' $type reuses $techn definition of $tags
$getElementLine("rectangle", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemDb_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "external_system")
database "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("external_system", $tags) as $alias $getLink($link)
' $type reuses $techn definition of $tags
$getElementLine("database", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

!unquoted procedure SystemQueue_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="", $type="")
!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_system")
' $type reuses $techn definition of $tags
!$type=$toElementArg($type, $tags, "ElementTagTechn", "external_system")
queue "$getSystem($label, $type, $descr, $sprite)$getProps()" $toStereos("external_system", $tags) as $alias $getLink($link)
' $type reuses $techn definition of $tags
$getElementLine("queue", "external_system", $alias, $label, $type, $descr, $sprite, $tags, $link)
!endprocedure

' Boundaries
Expand Down
Loading