diff --git a/.vscode/settings.json b/.vscode/settings.json index 7233980..c1c895a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { "plantuml.server": "http://localhost:8089", "plantuml.render": "PlantUMLServer", - "plantuml.diagramsRoot": "base", } \ No newline at end of file diff --git a/Container.puml b/Container.puml index c6bdcae..369d339 100644 --- a/Container.puml +++ b/Container.puml @@ -1,5 +1,5 @@ @startuml Visa Card To Wallet - Middleware -!include C4_Container.puml +!include System(mobileAppRef, "Customer App") System(fintechRef, "Fintech") @@ -19,4 +19,4 @@ BiRel(apiRef, dbRef, "Read/Write", "SDK") Rel(apiRef, cacheRef, "Read", "SDK") Rel(apiRef, logsRef, "Write", "SDK") Rel(visaRef, apiRef, "Transaction Response", "WebHook") -@enduml \ No newline at end of file +@enduml diff --git a/Context.puml b/Context.puml index c66700c..3f639e7 100644 --- a/Context.puml +++ b/Context.puml @@ -1,5 +1,5 @@ @startuml Visa Card To Wallet - System -!include C4_Context.puml +!include Person(customerRef, "Customer") System(mainRef, "Mainframe") @@ -9,4 +9,4 @@ Rel(customerRef, mainRef, "Requests Top-up from Visa Card") Rel(mainRef, visaRef, "Redirects Customer to Visa Gateway") Rel(visaRef, mainRef, "Saves Transaction Data") Rel(mainRef, customerRef, "Result") -@enduml \ No newline at end of file +@enduml diff --git a/base/C4.puml b/base/C4.puml deleted file mode 100644 index 3f82416..0000000 --- a/base/C4.puml +++ /dev/null @@ -1,1135 +0,0 @@ -' C4-PlantUML - -'Version -' ################################## -!function C4Version() - !return "2.4.0" -!end function - -!procedure C4VersionDetails() -rectangle C4VersionDetailsArea <> [ -| PlantUML | **%version()** | -| C4-PlantUML | **C4Version()** | -] -!end procedure - -' Colors -' ################################## - -!global $ELEMENT_FONT_COLOR = "#FFFFFF" - -!global $ARROW_COLOR = "#666666" - -!global $BOUNDARY_COLOR = "#444444" -!global $BOUNDARY_BG_COLOR = "transparent" - -!global $LEGEND_FONT_COLOR = "#FFFFFF" -!global $LEGEND_TITLE_COLOR = "#000000" -' %darken(darkkhaki,50), #khaki -!global $LEGEND_DARK_COLOR = "#66622E" -!global $LEGEND_LIGHT_COLOR = "#khaki" - -' Labels -' ################################## - -!global $LEGEND_SHADOW_TEXT = "(shadow) " -!global $LEGEND_NO_SHADOW_TEXT = "(no shadow) " -!global $LEGEND_NO_FONT_BG_TEXT = "(no text, no back color) " -!global $LEGEND_NO_FONT_TEXT = "(no text color) " -!global $LEGEND_NO_BG_TEXT = "(no back color) " -!global $LEGEND_NO_LINE_TEXT = "(no line color) " -!global $LEGEND_ROUNDED_BOX = "(rounded box) " -!global $LEGEND_EIGHT_SIDED = "(eight sided) " -!global $LEGEND_DOTTED_LINE = "(dotted) " -!global $LEGEND_DASHED_LINE = "(dashed) " -!global $LEGEND_BOLD_LINE = "(bold) " - -' Styling -' ################################## - -!global $TECHN_FONT_SIZE = 12 -!global $ROUNDED_BOX_SIZE = 25 -!global $EIGHT_SIDED_SIZE = 18 - -!global $ROUNDED_BOX = "roundedBox" -!global $EIGHT_SIDED = "eightSided" - -!global $DOTTED_LINE = "dotted" -!global $DASHED_LINE = "dashed" -!global $BOLD_LINE = "bold" - -skinparam defaultTextAlignment center - -skinparam wrapWidth 200 -skinparam maxMessageSize 150 - -skinparam LegendBorderColor transparent -skinparam LegendBackgroundColor transparent -skinparam LegendFontColor $LEGEND_FONT_COLOR - -skinparam shadowing<> false -' #00000000 is transparent -skinparam rectangle<> { - backgroundcolor #00000000 - bordercolor #00000000 -} - -skinparam rectangle { - StereotypeFontSize 12 - shadowing false -} - -skinparam database { - StereotypeFontSize 12 - shadowing false -} - -skinparam queue { - StereotypeFontSize 12 - shadowing false -} - -skinparam arrow { - Color $ARROW_COLOR - FontColor $ARROW_COLOR - FontSize 12 -} - -skinparam actor { - StereotypeFontSize 12 - shadowing false - style awesome -} - -skinparam person { - StereotypeFontSize 12 - shadowing false -} - -' Some boundary skinparams have to be set as package skinparams too (PlantUML uses internal packages) -skinparam package { - StereotypeFontSize 6 - StereotypeFontColor $BOUNDARY_BG_COLOR - FontStyle plain - BackgroundColor $BOUNDARY_BG_COLOR -} - -skinparam rectangle<> { - Shadowing false - StereotypeFontSize 6 - StereotypeFontColor $BOUNDARY_BG_COLOR - FontColor $BOUNDARY_COLOR - BorderColor $BOUNDARY_COLOR - BackgroundColor $BOUNDARY_BG_COLOR - BorderStyle dashed -} - -' Legend and Tags -' ################################## -!global $tagDefaultLegend = "" -!global $tagCustomLegend = "" - -' rel specific -!unquoted function $toStereos($tags) - !if (%strlen($tags) == 0) - !return '' - !endif - !$stereos = '' - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$stereos = $stereos + '<<' + $tag + '>>' -%set_variable_value("$" + $tag + "_LineLegend", %true()) - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$stereos = $stereos + '<<' + $tags + '>>' -%set_variable_value("$" + $tags + "_LineLegend", %true()) - !endif - !return $stereos -!endfunction - -' if $sprite/$techn is an empty argument, try to calculate it via the defined $tag -!unquoted function $toRelArg($arg, $tags, $varPostfix) - !if ($arg > "") - !return $arg - !endif - - !if (%strlen($tags) == 0) - !return $arg - !endif - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$newArg = %get_variable_value("$" + $tag + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$newArg = %get_variable_value("$" + $tags + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !endif - !return $arg -!endfunction - -' element specific (unused are hidden based on mask) -!unquoted function $toStereos($elementType, $tags) - !if (%strlen($tags) == 0) - !$stereos = '<<' + $elementType + '>>' -%set_variable_value("$" + $elementType + "Legend", %true()) - !return $stereos - !endif - !$stereos = '' - !$mask = $resetMask() - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$stereos = $stereos + '<<' + $tag + '>>' - !$mergedMask = $combineMaskWithTag($mask, $tag) - !if ($mergedMask != $mask) -%set_variable_value("$" + $tag + "Legend", %true()) - !$mask = $mergedMask - !endif - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$stereos = $stereos + '<<' + $tags + '>>' - !$mergedMask = $combineMaskWithTag($mask, $tags) - !if ($mergedMask != $mask) -%set_variable_value("$" + $tags + "Legend", %true()) - !$mask = $mergedMask - !endif - !endif - ' has to be last, otherwise PlantUML overwrites all tag specific skinparams - !$stereos = $stereos + '<<' + $elementType + '>>' - !$mergedMask = $combineMaskWithTag($mask, $elementType) - !if ($mergedMask != $mask) -%set_variable_value("$" + $elementType + "Legend", %true()) - !$mask = $mergedMask - !endif - !return $stereos -!endfunction - -' if $sprite/$techn is an empty argument, try to calculate it via the defined $tag -!unquoted function $toElementArg($arg, $tags, $varPostfix, $elementType) - !if ($arg > "") - !return $arg - !endif - - !if (%strlen($tags) == 0) - !$newArg = %get_variable_value("$" + $elementType + $varPostfix) - !if ($newArg > "") - !return $newArg - !else - !return $arg - !endif - !endif - !$brPos = %strpos($tags, "+") - !while ($brPos >= 0) - !$tag = %substr($tags, 0, $brPos) - !$newArg = %get_variable_value("$" + $tag + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !$tags = %substr($tags, $brPos+1) - !$brPos = %strpos($tags, "+") - !endwhile - !if (%strlen($tags) > 0) - !$newArg = %get_variable_value("$" + $tags + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !$newArg = %get_variable_value("$" + $elementType + $varPostfix) - !if ($newArg > "") - !return $newArg - !endif - !endif - !return $arg -!endfunction - -!function $elementTagSkinparams($element, $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape) - !$elementSkin = "skinparam " + $element + "<<" + $tagStereo + ">> {" + %newline() - !if ($fontColor != "") - !if ($tagStereo != "boundary") - !$elementSkin = $elementSkin + " StereotypeFontColor " + $fontColor + %newline() - !endif - !$elementSkin = $elementSkin + " FontColor " + $fontColor + %newline() - !endif - !if ($bgColor != "") - !$elementSkin = $elementSkin + " BackgroundColor " + $bgColor + %newline() - !endif - !if ($borderColor != "") - !$elementSkin = $elementSkin + " BorderColor " + $borderColor+ %newline() - !endif - !if ($shadowing == "true") - !$elementSkin = $elementSkin + " Shadowing<<" + $tagStereo + ">> " + "true" + %newline() - !endif - !if ($shadowing == "false") - !$elementSkin = $elementSkin + " Shadowing<<" + $tagStereo + ">> " + "false" + %newline() - !endif - ' only rectangle supports shape(d corners), define both skinparam that overlays are working - !if ($shape != "" && $element == "rectangle") - !if ($shape == $ROUNDED_BOX) - !$elementSkin = $elementSkin + " RoundCorner " + $ROUNDED_BOX_SIZE+ %newline() - !$elementSkin = $elementSkin + " DiagonalCorner " + "0" + %newline() - !elseif ($shape == $EIGHT_SIDED) - !$elementSkin = $elementSkin + " RoundCorner " + "0" + %newline() - !$elementSkin = $elementSkin + " DiagonalCorner " + $EIGHT_SIDED_SIZE+ %newline() - !endif - !endif - !$elementSkin = $elementSkin + "}" + %newline() - !return $elementSkin -!endfunction - -!unquoted procedure $defineSkinparams($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape) - ' only rectangle supports shape(d corners) - !$tagSkin = $elementTagSkinparams("rectangle", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape) - !$tagSkin = $tagSkin + $elementTagSkinparams("database", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "") - !$tagSkin = $tagSkin + $elementTagSkinparams("queue", $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, "") - !$tagSkin = $tagSkin + $elementTagSkinparams("person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "") - !if ($tagStereo == "boundary" && $bgColor != "") - !$tagSkin = $tagSkin + "skinparam package<>StereotypeFontColor " + $bgColor + %newline() - !$tagSkin = $tagSkin + "skinparam rectangle<>StereotypeFontColor " + $bgColor + %newline() - !endif -$tagSkin -!endprocedure - -' arrow colors cannot start with # (legend background has to start with #) -!function $colorWithoutHash($c) - !if (%substr($c, 0, 1) == "#") - !$c = %substr($c,1) - !endif - !return $c -!endfunction - -!unquoted procedure $defineRelSkinparams($tagStereo, $textColor, $lineColor, $lineStyle) - !$elementSkin = "skinparam arrow<<" + $tagStereo + ">> {" + %newline() - !$elementSkin = $elementSkin + " Color " - !if ($lineColor != "") - !$elementSkin = $elementSkin + $colorWithoutHash($lineColor) - !endif - !if ($textColor != "") - !$elementSkin = $elementSkin + ";text:" + $colorWithoutHash($textColor) - !endif - !if ($lineStyle != "") - !$elementSkin = $elementSkin + ";line." + $lineStyle - !endif - !$elementSkin = $elementSkin + %newline() - !$elementSkin = $elementSkin + "}" + %newline() -$elementSkin -!endprocedure - -' %is_dark() requires PlantUML version >= 1.2021.6 -!if (%function_exists("%is_dark")) - !$PlantUMLSupportsDynamicLegendColor = %true() -!else - !$PlantUMLSupportsDynamicLegendColor = %false() - !log "dynamic undefined legend colors" requires PlantUML version >= 1.2021.6, therefore only static assigned colors are used -!endif - -!unquoted function $contrastLegend($color) - !if (%is_dark($color)) - !$value = $LEGEND_LIGHT_COLOR - !else - !$value = $LEGEND_DARK_COLOR - !endif - !return $value -!endfunction - -!unquoted function $flatLegend($color) - !if (%is_dark($color)) - !$value = $LEGEND_DARK_COLOR - !else - !$value = $LEGEND_LIGHT_COLOR - !endif - !return $value -!endfunction - -' legend background has to start with # -!function $colorWithHash($c) - !if (%substr($c, 0, 1) != "#") - !$c = "#" + $c - !endif - !return $c -!endfunction - -!function $addMaskFlag($mask, $attr) - !if ($attr == "") - !$mask = $mask + "0" - !else - !$mask = $mask + "1" - !endif - !return $mask -!endfunction - -!function $orFlags($flag1, $flag2) - !if ($flag1 == "0" && $flag2 == "0") - !return "0" - !endif - !return "1" -!endfunction - -!function $tagLegendMask($bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite) - !$mask = "" - !$mask = $addMaskFlag($mask, $bgColor) - !$mask = $addMaskFlag($mask, $fontColor) - !$mask = $addMaskFlag($mask, $borderColor) - !$mask = $addMaskFlag($mask, $shadowing) - !$mask = $addMaskFlag($mask, $shape) - !$mask = $addMaskFlag($mask, $sprite) - !return $mask -!endfunction - -!function $resetMask() - !return "000000" -!endfunction - -!function $combineMasks($mask1, $mask2) - !$mask = "" - !$mask = $mask + $orFlags(%substr($mask1, 0, 1), %substr($mask2, 0, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 1, 1), %substr($mask2, 1, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 2, 1), %substr($mask2, 2, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 3, 1), %substr($mask2, 3, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 4, 1), %substr($mask2, 4, 1)) - !$mask = $mask + $orFlags(%substr($mask1, 5, 1), %substr($mask2, 5, 1)) - !return $mask -!endfunction - -!function $combineMaskWithTag($mask1, $tag) - !$mask2 = %get_variable_value("$" + $tag+ "LegendMask") - !if ($mask2 == "") - ' !log combineMaskWithTag $mask1, $tag, ... only $mask1 - !return $mask1 - !endif - - ' !log combineMaskWithTag $mask1, $tag, $mask2 ... $combineMasks($mask1, $mask2) - !return $combineMasks($mask1, $mask2) -!endfunction - -' element symbols typically 4 times too big in legend -!function $smallVersionSprite($sprite) - ' ,scale= ... has to be first (...,color=black,scale=0.25... is invalid too) - !if (%strpos($sprite, "=") < 0) - !if (%substr($sprite, 0, 4) == "img:") - !$smallSprite = $sprite + "{scale=0.25}" - !else - !$smallSprite = $sprite + ",scale=0.25" - !endif - !else - !$smallSprite = $sprite - !endif - !return $smallSprite -!endfunction - -' format sprite that it can be used in diagram -!function $getSprite($sprite) - ' if it starts with & it's a OpenIconic, details see https://useiconic.com/open/ - ' if it starts with img: it's an image, details see https://plantuml.com/creole - !if (%substr($sprite, 0, 1) != "&" && %substr($sprite, 0, 4) != "img:") - !$formatted = "<$" + $sprite + ">" - !else - !$formatted = "<" + $sprite + ">" - !endif - !return $formatted -!endfunction - -!function $tagLegendEntry($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite) - !$bg = $bgColor - !$fo = $fontColor - !$bo = $borderColor - - !if ($fo == "") - !if ($bg != "") -!if ($PlantUMLSupportsDynamicLegendColor) - !$fo = $contrastLegend($bg) -!else - !$fo = $LEGEND_DARK_COLOR -!endif - !else - !if ($bo == "") - !$fo = $LEGEND_DARK_COLOR - !$bg = $LEGEND_LIGHT_COLOR - !else -!if ($PlantUMLSupportsDynamicLegendColor) - !$fo = $flatLegend($bo) - !$bg = $contrastLegend($bo) -!else - !$fo = $LEGEND_DARK_COLOR - !$bg = $LEGEND_LIGHT_COLOR -!endif - !endif - !endif - !else - !if ($bg == "") -!if ($PlantUMLSupportsDynamicLegendColor) - !$bg = $contrastLegend($fo) -!else - !$bg = $LEGEND_LIGHT_COLOR -!endif - !endif - !endif - - !if ($bo == "") - !$bo = $bg - !endif - - !$tagEntry = "|" - !$tagEntry = $tagEntry + "<" + $colorWithHash($bg) +">" - ' ..white rectangle - !$tagEntry = $tagEntry + " " - !$tagEntry = $tagEntry + "" - !if ($legendSprite != "") - !$tagEntry = $tagEntry + $getSprite($legendSprite) + " " - !endif - !if ($legendText == "") - !$tagEntry = $tagEntry + " " + $tagStereo + " " - !if ($shadowing == "true") - !$tagEntry = $tagEntry + $LEGEND_SHADOW_TEXT - !endif - !if ($shadowing == "false") - !$tagEntry = $tagEntry + $LEGEND_NO_SHADOW_TEXT - !endif - !if ($shape == $ROUNDED_BOX) - !$tagEntry = $tagEntry + $LEGEND_ROUNDED_BOX - !endif - !if ($shape == $EIGHT_SIDED) - !$tagEntry = $tagEntry + $LEGEND_EIGHT_SIDED - !endif - !if ($fontColor == "" && $bgColor == "") - !$tagEntry = $tagEntry + $LEGEND_NO_FONT_BG_TEXT - !else - !if ($fontColor == "") - !$tagEntry = $tagEntry + $LEGEND_NO_FONT_TEXT - !endif - !if ($bgColor == "") - !$tagEntry = $tagEntry + $LEGEND_NO_BG_TEXT - !endif - !endif - !else - !$tagEntry = $tagEntry + " " + $legendText + " " - !endif - - !$tagEntry = $tagEntry + " " - !$tagEntry = $tagEntry + "|" - !return $tagEntry -!endfunction - -!function $tagRelLegendEntry($tagStereo, $textColor, $lineColor, $lineStyle, $legendText, $legendSprite) - !$tc = $textColor - !$lc = $lineColor - - !if ($tc == "") - !if ($PlantUMLSupportsDynamicLegendColor) - !$tc = $flatLegend($ARROW_COLOR) - !else - !$tc = $LEGEND_DARK_COLOR - !endif - !endif - !if ($lc == "") - !if ($PlantUMLSupportsDynamicLegendColor) - !$lc = $flatLegend($ARROW_COLOR) - !else - !$lc = $LEGEND_DARK_COLOR - !endif - !endif - - !$tagEntry = "|" - ' ..white line - !$tagEntry = $tagEntry + " " - !$tagEntry = $tagEntry + "" - !if ($legendSprite != "") - !$tagEntry = $tagEntry + $getSprite($legendSprite) + " " - !endif - !if ($legendText == "") - !$tagEntry = $tagEntry + " " + $tagStereo + " " - !if ($textColor == "") - !$tagEntry = $tagEntry + $LEGEND_NO_FONT_TEXT - !endif - !if ($lineColor == "") - !$tagEntry = $tagEntry + $LEGEND_NO_LINE_TEXT - !endif - !if ($lineStyle != "") - !if ($lineStyle == $DOTTED_LINE) - !$tagEntry = $tagEntry + $LEGEND_DOTTED_LINE - !elseif ($lineStyle == $DASHED_LINE) - !$tagEntry = $tagEntry + $LEGEND_DASHED_LINE - !elseif ($lineStyle == $BOLD_LINE) - !$tagEntry = $tagEntry + $LEGEND_BOLD_LINE - !else - !$tagEntry = $tagEntry + "(" + $lineStyle + ") " - !endif - !endif - !else - !$tagEntry = $tagEntry + " " + $legendText + " " - !endif - - !$tagEntry = $tagEntry + " " - !$tagEntry = $tagEntry + "|" - !return $tagEntry -!endfunction - -!global $LEGEND_DOTTED_LINE = "(dotted) " -!global $LEGEND_DASHED_LINE = "(dashed) " -!global $LEGEND_BOLD_LINE = "(bold) " - -!unquoted procedure $addTagToLegend($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $legendText="", $legendSprite="") -'' if a combined element tag is defined (e.g. "v1.0&v1.1") then it is typically a merged color, -'' like a new $fontColor="#fdae61" therefore it should be added to the legend -'' and the & combined tags will be not removed -' !if (%strpos($tagStereo, "&") < 0) - !$tagEntry = $tagLegendEntry($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite) -%set_variable_value("$" + $tagStereo + "LegendEntry", $tagEntry) - !$tagCustomLegend = $tagCustomLegend + $tagStereo + "\n" - !$tagMask = $tagLegendMask( $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite) -%set_variable_value("$" + $tagStereo + "LegendMask", $tagMask) -' !endif -!endprocedure - -!unquoted procedure $addRelTagToLegend($tagStereo, $textColor="", $lineColor="", $lineStyle="", $legendText="", $legendSprite="") -'' Arrows have a bug with stereotype/skinparams and cannot combine text colors of one stereotype -'' and the line color of another stereotype. Therefore the text color of one tag and the line color -'' of another tag have to be combined via a "workaround" tag ("v1.0&v1.1"). -'' This workaround tag could be theoretically removed in the legend but after that there would -'' be an inconsistency between the element tags and the rel tags and therefore -'' & combined workaround tags are not removed too (and in unlikely cases the color itself could be changed) -' !if (%strpos($tagStereo, "&") < 0) - !$tagEntry = $tagRelLegendEntry($tagStereo, $textColor, $lineColor, $lineStyle, $legendText, $legendSprite) -%set_variable_value("$" + $tagStereo + "_LineLegendEntry", $tagEntry) - !$tagCustomLegend = $tagCustomLegend + $tagStereo + "_Line\n" -' !endif -!endprocedure - -!procedure $showActiveLegendEntries($allDefined) - !$brPos = %strpos($allDefined, "\n") - !while ($brPos >= 0) - !$tagStereo = %substr($allDefined, 0, $brPos) - !$allDefined = %substr($allDefined, $brPos+2) - !$brPos = %strpos($allDefined, "\n") - !if (%variable_exists("$" + $tagStereo + "Legend")) -%get_variable_value("$" + $tagStereo + "LegendEntry") - !endif - !endwhile - !if (%strlen($allDefined) > 0) - !$tagStereo = $allDefined - !if (%variable_exists("$" + $tagStereo + "Legend")) -%get_variable_value("$" + $tagStereo + "LegendEntry") - !endif - !endif -!endprocedure - -!function RoundedBoxShape() -!return $ROUNDED_BOX -!endfunction - -!function EightSidedShape() -!return $EIGHT_SIDED -!endfunction - -!function DottedLine() -!return $DOTTED_LINE -!endfunction - -!function DashedLine() -!return $DASHED_LINE -!endfunction - -!function BoldLine() -!return $BOLD_LINE -!endfunction - -' used by new defined tags -!unquoted procedure AddElementTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="") -$defineSkinparams($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape) - !if ($sprite!="") -%set_variable_value("$" + $tagStereo + "ElementTagSprite", $sprite) - !if ($legendSprite == "") - !$legendSprite = $smallVersionSprite($sprite) - !endif - !endif - !if ($techn != "") -%set_variable_value("$" + $tagStereo + "ElementTagTechn", $techn) - !endif -$addTagToLegend($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite) -!endprocedure - -' used by new defined rel tags -!unquoted procedure AddRelTag($tagStereo, $textColor="", $lineColor="", $lineStyle = "", $sprite="", $techn="", $legendText="", $legendSprite="") -$defineRelSkinparams($tagStereo, $textColor, $lineColor, $lineStyle) - !if ($sprite != "") -%set_variable_value("$" + $tagStereo + "RelTagSprite", $sprite) - !if ($legendSprite == "") - ' relation symbols typically 1:1 no additional scale required - !$legendSprite = $sprite - !endif - !endif - !if ($techn != "") -%set_variable_value("$" + $tagStereo + "RelTagTechn", $techn) - !endif -$addRelTagToLegend($tagStereo, $textColor, $lineColor, $lineStyle, $legendText, $legendSprite) -!endprocedure - -' update the style of existing elements like person, ... -!unquoted procedure UpdateElementStyle($elementName, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="") -$defineSkinparams($elementName, $bgColor, $fontColor, $borderColor, $shadowing, $shape) - !if ($sprite != "") -%set_variable_value("$" + $elementName + "ElementTagSprite", $sprite) - !if ($legendSprite == "") - !$legendSprite = $smallVersionSprite($sprite) - !endif - !endif - !if ($techn != "") -%set_variable_value("$" + $elementName + "ElementTagTechn", $techn) - !endif - !$tagEntry = $tagLegendEntry($elementName, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $legendText, $legendSprite) -%set_variable_value("$" + $elementName + "LegendEntry", $tagEntry) - ' default tags sets at least bgColor and fontColor - !$tagMask = $tagLegendMask("CHANGED", "CHANGED", $borderColor, $shadowing, $shape, $sprite) -%set_variable_value("$" + $elementName + "LegendMask", $tagMask) -!endprocedure - -/' @deprecated in favor of UpdateElementStyle '/ -!unquoted procedure UpdateSkinparamsAndLegendEntry($elementName, $bgColor="", $fontColor="", $borderColor="", $shadowing="") -UpdateElementStyle($elementName, $bgColor, $fontColor, $borderColor, $shadowing) -!endprocedure - -' update the style of default relation, it has to set both properties (combined statement not working) -!unquoted procedure UpdateRelStyle($textColor, $lineColor) - !$elementSkin = "skinparam arrow {" + %newline() - !$elementSkin = $elementSkin + " Color " + $lineColor + %newline() - !$elementSkin = $elementSkin + " FontColor " + $textColor + %newline() - !$elementSkin = $elementSkin + "}" + %newline() -$elementSkin -!endprocedure - -' tags/stereotypes have to be delimited with \n -!unquoted procedure SetDefaultLegendEntries($tagStereoEntries) - !$tagDefaultLegend = $tagStereoEntries -!endprocedure - -' Links -' ################################## - -!function $getLink($link) - !if ($link != "") - !return "[[" + $link + "]]" - !else - !return "" - !endif -!endfunction - -' Line breaks -' ################################## - -' PlantUML supports no DETERMINISTIC/automatic line breaks of "PlantUML line" (C4 Relashionships) -' therefore Rel...() implements an automatic line break based on spaces (like in all other objects). -' If a $type contains \n then these are used (and no automatic space based line breaks are done) -' $REL_TECHN_MAX_CHAR_WIDTH defines the automatic line break position -!global $REL_TECHN_MAX_CHAR_WIDTH = 35 -!global $REL_DESCR_MAX_CHAR_WIDTH = 32 - -!unquoted function $breakDescr($descr, $widthStr) -!$width = %intval($widthStr) -!$multiLine = "" -!if (%strpos($descr, "\n") >= 0) -!else - !while (%strlen($descr) > $width) - !$brPos = $width - !while ($brPos > 0 && %substr($descr, $brPos, 1) != ' ') - !$brPos = $brPos - 1 - !endwhile - - !if ($brPos < 1) - !$brPos = %strpos($descr, " ") - !else - !endif - - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($descr, 0, $brPos) + "\n" - !$descr = %substr($descr, $brPos + 1) - !else - !$multiLine = $multiLine+ $descr - !$descr = "" - !endif - !endwhile -!endif -!if (%strlen($descr) > 0) - !$multiLine = $multiLine + $descr -!endif -!return $multiLine -!endfunction - -' $breakTechn() supports //...//; $breakNode() in C4_Deployment supports no //....// -!unquoted function $breakTechn($techn, $widthStr) -!$width = %intval($widthStr) -!$multiLine = "" -!if (%strpos($techn, "\n") >= 0) - !while (%strpos($techn, "\n") >= 0) - !$brPos = %strpos($techn, "\n") - !$multiLine = $multiLine + %substr($techn, 0, $brPos) + '//\n//' - !$techn = %substr($techn, $brPos+2) - !endwhile -!else - !while (%strlen($techn) > $width) - !$brPos = $width - !while ($brPos > 0 && %substr($techn, $brPos, 1) != ' ') - !$brPos = $brPos - 1 - !endwhile - - !if ($brPos < 1) - !$brPos = %strpos($techn, " ") - !else - !endif - - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($techn, 0, $brPos) + '//\n//' - !$techn = %substr($techn, $brPos + 1) - !else - !$multiLine = $multiLine+ $techn - !$techn = "" - !endif - !endwhile -!endif -!if (%strlen($techn) > 0) - !$multiLine = $multiLine + $techn -!endif -!return $multiLine -!endfunction - -' Element properties -' ################################## - -' collect all defined properties as table rows -!global $propTable = "" -!global $propTableCaption = "" -!global $propColCaption = "=" - -!unquoted function SetPropertyHeader($col1Name, $col2Name, $col3Name = "", $col4Name = "") - !$propColCaption = "" - !$propTableCaption = "|= " + $col1Name + " |= " + $col2Name + " |" - !if ($col3Name != "") - !$propTableCaption = $propTableCaption + "= " + $col3Name + " |" - !endif - !if ($col4Name != "") - !$propTableCaption = $propTableCaption + "= " + $col4Name + " |" - !endif - !return "" -!endfunction - -!unquoted function WithoutPropertyHeader() - !$propTableCaption = "" - !$propColCaption = "=" - !return "" -!endfunction - -!unquoted function AddProperty($col1, $col2, $col3 = "", $col4 = "") - !if ($propTable == "") - !if ($propTableCaption != "") - !$propTable = $propTableCaption + "\n" - !endif - !else - !$propTable = $propTable + "\n" - !endif - !$propTable = $propTable + "| " + $col1 + " |" + $propColCaption + " " + $col2 + " |" - !if ($col3 != "") - !$propTable = $propTable + " " + $col3 + " |" - !endif - !if ($col4 != "") - !$propTable = $propTable + " " + $col4 + " |" - !endif - !return "" -!endfunction - -!unquoted function $getProps($alignedNL = "\n") - !if ($propTable != "") - !$retTable = $alignedNL + $propTable - !$propTable = "" - !return $retTable - !endif - !return "" -!endfunction - -!unquoted function $getProps_L() - !return $getProps("\l") -!endfunction - -!unquoted function $getProps_R() - !return $getProps("\r") -!endfunction - -SetPropertyHeader("Property","Value") - -' Layout -' ################################## - -!procedure $getHideStereotype($hideStereotype) -!if ($hideStereotype == "true") -hide stereotype -!endif -!endprocedure - -!procedure $getLegendTable() -<#00000000,#00000000>|**Legend** | -$showActiveLegendEntries($tagDefaultLegend) -$showActiveLegendEntries($tagCustomLegend) -!endprocedure - -!procedure $getLegendArea($areaAlias, $hideStereotype) -$getHideStereotype($hideStereotype) -rectangle $areaAlias<> [ -$getLegendTable() -] -!endprocedure - -!procedure HIDE_STEREOTYPE() -hide stereotype -!endprocedure - -!procedure LAYOUT_AS_SKETCH() -skinparam backgroundColor #EEEBDC -skinparam handwritten true -skinparam defaultFontName "Comic Sans MS" -center footer Warning: Created for discussion, needs to be validated -!endprocedure - -!global $fix_direction=%false() - -!function $down($start,$end) -!if ($fix_direction) -!return $start+"RIGHT"+$end -!else -!return $start+"DOWN"+$end -!endif -!endfunction - -!function $up($start,$end) -!if ($fix_direction) -!return $start+"LEFT"+$end -!else -!return $start+"UP"+$end -!endif -!endfunction - -!function $left($start,$end) -!if ($fix_direction) -!return $start+"UP"+$end -!else -!return $start+"LEFT"+$end -!endif -!endfunction - -!function $right($start,$end) -!if ($fix_direction) -!return $start+"DOWN"+$end -!else -!return $start+"RIGHT"+$end -!endif -!endfunction - -!procedure LAYOUT_TOP_DOWN() -!global $fix_direction=%false() -top to bottom direction -!endprocedure - -!procedure LAYOUT_LEFT_RIGHT() -!global $fix_direction = %false() -left to right direction -!endprocedure - -!procedure LAYOUT_LANDSCAPE() -!global $fix_direction = %true() -left to right direction -!endprocedure - -' has to be last call in diagram -!unquoted procedure SHOW_LEGEND($hideStereotype="true") -$getHideStereotype($hideStereotype) -legend right -$getLegendTable() -endlegend -!endprocedure - -/' @deprecated in favor of SHOW_LEGEND '/ -!unquoted procedure SHOW_DYNAMIC_LEGEND($hideStereotype="true") -SHOW_LEGEND($hideStereotype) -!endprocedure - -' legend is reserved and cannot be uses as alias of SHOW_FLOATING_LEGEND() therefore -' LEGEND() is introduced. It returns the default name of the floating alias "floating_legend_alias" -' and can be used in the Lay_Distance() calls -!function LEGEND() -!return "floating_legend_alias" -!endfunction - -' enables that legend can be located in drawing area of the diagram. It has to be last call in diagram followed by Lay_Distance() -!unquoted procedure SHOW_FLOATING_LEGEND($alias=LEGEND(), $hideStereotype="true") -$getLegendArea($alias, $hideStereotype) -!endprocedure - -' Boundaries -' ################################## - -!function $getBoundary($label, $type) - !if ($type == "") - !return '==' + $label - !endif - !if (type != "") - !return '==' + $label + '\n[' + $type + ']' - !endif -!endfunction - -!unquoted procedure Boundary($alias, $label, $type="", $tags="", $link="") -rectangle "$getBoundary($label, $type)" $toStereos("boundary", $tags) as $alias $getLink($link) -!endprocedure - -' Relationship -' ################################## - -!function $getRel($direction, $alias1, $alias2, $label, $techn, $descr, $sprite, $tags, $link) - !$sprite = $toRelArg($sprite, $tags, "RelTagSprite") - !$techn = $toRelArg($techn, $tags, "RelTagTechn") - !$rel = $alias1 + ' ' + $direction + ' ' + $alias2 - !if ($tags != "") - !$rel = $rel + ' ' + $toStereos($tags) - !endif - !$rel = $rel + ' : ' - !if ($sprite != "") - !$rel = $rel + $getSprite($sprite) + ' ' - !endif - !if ($link != "") - !$rel = $rel + '**[[' + $link + ' ' + $label + ']]**' - !else - !$rel = $rel + '**' + $label + '**' - !endif - !if ($techn != "") - ' line break is not deterministic, calculate it - !$rel = $rel + '\n//[' + $breakTechn($techn, $REL_TECHN_MAX_CHAR_WIDTH) + ']//' - !endif - !if ($descr != "") - ' line break is not deterministic, calculate it - !$rel = $rel + '\n\n' + $breakDescr($descr, $REL_DESCR_MAX_CHAR_WIDTH) - !endif - !return $rel -!endfunction - -!unquoted procedure Rel_($alias1, $alias2, $label, $direction) -$alias1 $direction $alias2 : **$label** -!endprocedure -!unquoted procedure Rel_($alias1, $alias2, $label, $techn, $direction) -$alias1 $direction $alias2 : **$label**\n//[$techn]// -!endprocedure - -!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<--", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<->>", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-", $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure BiRel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure BiRel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -' Layout Helpers -' ################################## - -!function $getHiddenLine($distance) - !return '-[hidden]' + %substr('------------', 0, %intval($distance) + 1) -!endfunction - -!unquoted procedure Lay_D($from, $to) -$from -[hidden]D- $to -!endprocedure -!unquoted procedure Lay_U($from, $to) -$from -[hidden]U- $to -!endprocedure -!unquoted procedure Lay_R($from, $to) -$from -[hidden]R- $to -!endprocedure -!unquoted procedure Lay_L($from, $to) -$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. -' If a direction is required the Lay_...() methods can be used -!unquoted procedure Lay_Distance($from, $to, $distance="0") -$from $getHiddenLine($distance) $to -!endprocedure diff --git a/base/C4_Component.puml b/base/C4_Component.puml deleted file mode 100644 index 2f54173..0000000 --- a/base/C4_Component.puml +++ /dev/null @@ -1,104 +0,0 @@ -!include C4_Container.puml - -' Scope: A single container. -' Primary elements: Components within the container in scope. -' Supporting elements: Containers (within the software system in scope) plus people and software systems directly connected to the components. -' Intended audience: Software architects and developers. - -' Colors -' ################################## - -!global $COMPONENT_FONT_COLOR = "#000000" - -!global $COMPONENT_BG_COLOR = "#85BBF0" -!global $COMPONENT_BORDER_COLOR = "#78A8D8" -!global $EXTERNAL_COMPONENT_BG_COLOR = "#CCCCCC" -!global $EXTERNAL_COMPONENT_BORDER_COLOR = "#BFBFBF" - -' Styling -' ################################## - -UpdateElementStyle("component", $COMPONENT_BG_COLOR, $COMPONENT_FONT_COLOR, $COMPONENT_BORDER_COLOR) -UpdateElementStyle("external_component", $EXTERNAL_COMPONENT_BG_COLOR, $COMPONENT_FONT_COLOR, $EXTERNAL_COMPONENT_BORDER_COLOR) - -' shortcuts with default colors -!unquoted procedure AddComponentTag($tagStereo, $bgColor=$COMPONENT_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$COMPONENT_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="") - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite) -!endprocedure -!unquoted procedure AddExternalComponentTag($tagStereo, $bgColor=$EXTERNAL_COMPONENT_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$EXTERNAL_COMPONENT_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="") - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite) -!endprocedure - -' Layout -' ################################## - -SetDefaultLegendEntries("person\nsystem\ncontainer\ncomponent\nexternal_person\nexternal_system\nexternal_container\nexternal_component") - -!procedure LAYOUT_WITH_LEGEND() -hide stereotype -legend right -|**Legend** | -|<$PERSON_BG_COLOR> person | -|<$SYSTEM_BG_COLOR> system | -|<$CONTAINER_BG_COLOR> container | -|<$COMPONENT_BG_COLOR> component | -|<$EXTERNAL_PERSON_BG_COLOR> external person | -|<$EXTERNAL_SYSTEM_BG_COLOR> external system | -|<$EXTERNAL_CONTAINER_BG_COLOR> external container | -|<$EXTERNAL_COMPONENT_BG_COLOR> external component | -endlegend -!endprocedure - -' Elements -' ################################## - -!function $getComponent($label, $techn, $descr, $sprite) -!if ($descr == "") && ($sprite == "") -!return '=='+$label+'\n//['+$techn+']//' -!endif -!if ($descr == "") && ($sprite != "") -!return $getSprite($sprite)+'\n=='+$label+'\n//['+$techn+']//' -!endif -!if ($descr != "") && ($sprite == "") -!return '=='+$label+'\n//['+$techn+']//\n\n '+$descr -!endif -!if ($descr != "") && ($sprite != "") -!return $getSprite($sprite)+'\n=='+$label+'\n//['+$techn+']//\n\n '+$descr -!endif -!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) -!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) -!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) -!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) -!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) -!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) -!endprocedure diff --git a/base/C4_Container.puml b/base/C4_Container.puml deleted file mode 100644 index 3a5e09d..0000000 --- a/base/C4_Container.puml +++ /dev/null @@ -1,106 +0,0 @@ -!include C4_Context.puml - -' Scope: A single software system. -' Primary elements: Containers within the software system in scope. -' Supporting elements: People and software systems directly connected to the containers. -' Intended audience: Technical people inside and outside of the software development team; including software architects, developers and operations/support staff. - -' Colors -' ################################## - -!global $CONTAINER_BG_COLOR = "#438DD5" -!global $CONTAINER_BORDER_COLOR = "#3C7FC0" -!global $EXTERNAL_CONTAINER_BG_COLOR = "#B3B3B3" -!global $EXTERNAL_CONTAINER_BORDER_COLOR = "#A6A6A6" - -' Styling -' ################################## -UpdateElementStyle("container", $CONTAINER_BG_COLOR, $ELEMENT_FONT_COLOR, $CONTAINER_BORDER_COLOR) -UpdateElementStyle("external_container", $EXTERNAL_CONTAINER_BG_COLOR, $ELEMENT_FONT_COLOR, $EXTERNAL_CONTAINER_BORDER_COLOR) - -' shortcuts with default colors -!unquoted procedure AddContainerTag($tagStereo, $bgColor=$CONTAINER_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$CONTAINER_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="") - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite) -!endprocedure -!unquoted procedure AddExternalContainerTag($tagStereo, $bgColor=$EXTERNAL_CONTAINER_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$EXTERNAL_CONTAINER_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="") - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite) -!endprocedure - -' Layout -' ################################## - -SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container") - -!procedure LAYOUT_WITH_LEGEND() -hide stereotype -legend right -|**Legend** | -|<$PERSON_BG_COLOR> person | -|<$SYSTEM_BG_COLOR> system | -|<$CONTAINER_BG_COLOR> container | -|<$EXTERNAL_PERSON_BG_COLOR> external person | -|<$EXTERNAL_SYSTEM_BG_COLOR> external system | -|<$EXTERNAL_CONTAINER_BG_COLOR> external container | -endlegend -!endprocedure - -' Elements -' ################################## - -!function $getContainer($label, $techn, $descr, $sprite) -!if ($descr == "") && ($sprite == "") -!return '=='+$label+'\n//['+$techn+']//' -!endif -!if ($descr == "") && ($sprite != "") -!return $getSprite($sprite)+'\n=='+$label+'\n//['+$techn+']//' -!endif -!if ($descr != "") && ($sprite == "") -!return '=='+$label+'\n//['+$techn+']//\n\n '+$descr -!endif -!if ($descr != "") && ($sprite != "") -!return $getSprite($sprite)+'\n=='+$label+'\n//['+$techn+']//\n\n '+$descr -!endif -!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) -!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) -!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) -!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) -!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) -!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) -!endprocedure - -' Boundaries -' ################################## - -!unquoted procedure Container_Boundary($alias, $label, $tags="", $link="") -Boundary($alias, $label, "Container", $tags, $link) -!endprocedure diff --git a/base/C4_Context.puml b/base/C4_Context.puml deleted file mode 100644 index ac8e7c4..0000000 --- a/base/C4_Context.puml +++ /dev/null @@ -1,287 +0,0 @@ -!include C4.puml - -' Scope: A single software system. -' Primary elements: The software system in scope. -' Supporting elements: People and software systems directly connected to the software system in scope. -' Intended audience: Everybody, both technical and non-technical people, inside and outside of the software development team. - -' Colors -' ################################## - -!global $PERSON_BG_COLOR = "#08427B" -!global $PERSON_BORDER_COLOR = "#073B6F" -!global $EXTERNAL_PERSON_BG_COLOR = "#686868" -!global $EXTERNAL_PERSON_BORDER_COLOR = "#8A8A8A" -!global $SYSTEM_BG_COLOR = "#1168BD" -!global $SYSTEM_BORDER_COLOR = "#3C7FC0" -!global $EXTERNAL_SYSTEM_BG_COLOR = "#999999" -!global $EXTERNAL_SYSTEM_BORDER_COLOR = "#8A8A8A" - -' Styling -' ################################## - -UpdateElementStyle("person", $PERSON_BG_COLOR, $ELEMENT_FONT_COLOR, $PERSON_BORDER_COLOR) -UpdateElementStyle("external_person", $EXTERNAL_PERSON_BG_COLOR, $ELEMENT_FONT_COLOR, $EXTERNAL_PERSON_BORDER_COLOR) -UpdateElementStyle("system", $SYSTEM_BG_COLOR, $ELEMENT_FONT_COLOR, $SYSTEM_BORDER_COLOR) -UpdateElementStyle("external_system", $EXTERNAL_SYSTEM_BG_COLOR, $ELEMENT_FONT_COLOR, $EXTERNAL_SYSTEM_BORDER_COLOR) - -' shortcuts with default colors -!unquoted procedure AddPersonTag($tagStereo, $bgColor=$PERSON_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$PERSON_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="") - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, "", $legendText, $legendSprite) -!endprocedure -!unquoted procedure AddExternalPersonTag($tagStereo, $bgColor=$EXTERNAL_PERSON_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$EXTERNAL_PERSON_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="") - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, "", $legendText, $legendSprite) -!endprocedure -!unquoted procedure AddSystemTag($tagStereo, $bgColor=$SYSTEM_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$SYSTEM_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="") - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, "", $legendText, $legendSprite) -!endprocedure -!unquoted procedure AddExternalSystemTag($tagStereo, $bgColor=$EXTERNAL_SYSTEM_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$EXTERNAL_SYSTEM_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $legendText="", $legendSprite="") - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, "", $legendText, $legendSprite) -!endprocedure - -' Sprites -' ################################## - -sprite $person [48x48/16] { -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -0000000000000000000049BCCA7200000000000000000000 -0000000000000000006EFFFFFFFFB3000000000000000000 -00000000000000001CFFFFFFFFFFFF700000000000000000 -0000000000000001EFFFFFFFFFFFFFF80000000000000000 -000000000000000CFFFFFFFFFFFFFFFF6000000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -00000000000001FFFFFFFFFFFFFFFFFFF900000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFF00000000000000 -0000000000000BFFFFFFFFFFFFFFFFFFFF40000000000000 -0000000000000EFFFFFFFFFFFFFFFFFFFF70000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000DFFFFFFFFFFFFFFFFFFFF60000000000000 -0000000000000AFFFFFFFFFFFFFFFFFFFF40000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFE00000000000000 -00000000000000EFFFFFFFFFFFFFFFFFF800000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -000000000000000BFFFFFFFFFFFFFFFF5000000000000000 -0000000000000001DFFFFFFFFFFFFFF70000000000000000 -00000000000000000BFFFFFFFFFFFF500000000000000000 -0000000000000000005DFFFFFFFFA1000000000000000000 -0000000000000000000037ABB96100000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -000000000000025788300000000005886410000000000000 -000000000007DFFFFFFD9643347BFFFFFFFB400000000000 -0000000004EFFFFFFFFFFFFFFFFFFFFFFFFFFB1000000000 -000000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFD200000000 -00000006FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE10000000 -0000003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0000000 -000000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5000000 -000003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD000000 -000009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF200000 -00000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF600000 -00000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF800000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -00001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA00000 -00000EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF700000 -000006FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE100000 -0000008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD3000000 -000000014555555555555555555555555555555300000000 -000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000 -} - -sprite $person2 [48x48/16] { -0000000000000000000049BCCA7200000000000000000000 -0000000000000000006EFFFFFFFFB3000000000000000000 -00000000000000001CFFFFFFFFFFFF700000000000000000 -0000000000000001EFFFFFFFFFFFFFF80000000000000000 -000000000000000CFFFFFFFFFFFFFFFF6000000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -00000000000001FFFFFFFFFFFFFFFFFFF900000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFF00000000000000 -0000000000000BFFFFFFFFFFFFFFFFFFFF40000000000000 -0000000000000EFFFFFFFFFFFFFFFFFFFF70000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000FFFFFFFFFFFFFFFFFFFFF80000000000000 -0000000000000DFFFFFFFFFFFFFFFFFFFF60000000000000 -0000000000000AFFFFFFFFFFFFFFFFFFFF40000000000000 -00000000000006FFFFFFFFFFFFFFFFFFFE00000000000000 -00000000000000EFFFFFFFFFFFFFFFFFF800000000000000 -000000000000007FFFFFFFFFFFFFFFFFF100000000000000 -000000000000000BFFFFFFFFFFFFFFFF5000000000000000 -0000000000000001DFFFFFFFFFFFFFF70000000000000000 -00000000000000000BFFFFFFFFFFFF500000000000000000 -0000000000000000005DFFFFFFFFA1000000000000000000 -0000000000000000000037ABB96100000000000000000000 -000000000002578888300000000005888864100000000000 -0000000007DFFFFFFFFD9643347BFFFFFFFFFB4000000000 -00000004EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB10000000 -0000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD2000000 -000006FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE100000 -00003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB00000 -0000BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50000 -0003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0000 -0009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2000 -000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6000 -000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB000 -001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA000 -000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000 -000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6000 -0009FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFF2000 -0003FFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFFD0000 -0000BFFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFF50000 -00003FFFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFFB00000 -000006FFFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFFE100000 -0000007FFFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFFD2000000 -00000004EFFF8FFFFFFFFFFFFFFFFFFFFFF8FFFB10000000 -0000000007DF8FFFFFFFFFFFFFFFFFFFFFF8FB4000000000 -000000000002578888888888888888888864100000000000 -} - -' Layout -' ################################## - -SetDefaultLegendEntries("person\nsystem\nexternal_person\nexternal_system") - -!procedure LAYOUT_WITH_LEGEND() -hide stereotype -legend right -|**Legend** | -|<$PERSON_BG_COLOR> person | -|<$SYSTEM_BG_COLOR> system| -|<$EXTERNAL_PERSON_BG_COLOR> external person | -|<$EXTERNAL_SYSTEM_BG_COLOR> external system | -endlegend -!endprocedure - -!global $defaultPersonSprite = "person" -!global $portraitPerson = "false" - -!procedure HIDE_PERSON_SPRITE() - !$defaultPersonSprite = "" - !$portraitPerson = "false" -!endprocedure - -!unquoted procedure SHOW_PERSON_SPRITE($sprite="") - !if ($sprite == "") - !$defaultPersonSprite = "person" - !else - !$defaultPersonSprite = $sprite - !endif - !$portraitPerson = "false" -!endprocedure - -!unquoted procedure SHOW_PERSON_PORTRAIT() - !$defaultPersonSprite = "" - !$portraitPerson = "portrait" -!endprocedure - -!unquoted procedure SHOW_PERSON_OUTLINE() - !$defaultPersonSprite = "" - !$portraitPerson = "outline" -!endprocedure - -' Elements -' ################################## - -!function $getPerson($label, $descr, $sprite) -!if ($sprite == "") && ($defaultPersonSprite != "") - !$sprite = $defaultPersonSprite -!endif -!if ($descr == "") && ($sprite == "") - !return '=='+$label -!endif -!if ($descr == "") && ($sprite != "") - !return $getSprite($sprite)+'\n=='+$label -!endif -!if ($descr != "") && ($sprite == "") - !return '=='+$label+'\n\n '+$descr -!endif -!if ($descr != "") && ($sprite != "") - !return $getSprite($sprite)+'\n=='+$label+'\n\n '+$descr -!endif -!endfunction - -!function $getSystem($label, $descr, $sprite) -!if ($descr == "") && ($sprite == "") -!return '=='+$label -!endif -!if ($descr == "") && ($sprite != "") -!return $getSprite($sprite)+'\n=='+$label -!endif -!if ($descr != "") && ($sprite == "") -!return '=='+$label+'\n\n '+$descr -!endif -!if ($descr != "") && ($sprite != "") -!return $getSprite($sprite)+'\n=='+$label+'\n\n '+$descr -!endif -!endfunction - -!unquoted procedure Person($alias, $label, $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "person") -!if ($portraitPerson == "portrait") && ($sprite == "") -actor "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link) -!elseif ($portraitPerson == "outline") && ($sprite == "") -person "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link) -!else -rectangle "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link) -!endif -!endprocedure - -!unquoted procedure Person_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_person") -!if ($portraitPerson == "portrait") && ($sprite == "") -actor "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link) -!elseif ($portraitPerson == "outline") && ($sprite == "") -person "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link) -!else -rectangle "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link) -!endif -!endprocedure - -!unquoted procedure System($alias, $label, $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "system") -rectangle "$getSystem($label, $descr, $sprite)$getProps()" $toStereos("system", $tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure System_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_system") -rectangle "$getSystem($label, $descr, $sprite)$getProps()" $toStereos("external_system", $tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure SystemDb($alias, $label, $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "system") -database "$getSystem($label, $descr, $sprite)$getProps()" $toStereos("system", $tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure SystemQueue($alias, $label, $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "system") -queue "$getSystem($label, $descr, $sprite)$getProps()" $toStereos("system", $tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure SystemDb_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_system") -database "$getSystem($label, $descr, $sprite)$getProps()" $toStereos("external_system", $tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure SystemQueue_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "external_system") -queue "$getSystem($label, $descr, $sprite)$getProps()" $toStereos("external_system", $tags) as $alias $getLink($link) -!endprocedure - -' Boundaries -' ################################## - -!unquoted procedure Enterprise_Boundary($alias, $label, $tags="", $link="") -Boundary($alias, $label, "Enterprise", $tags, $link) -!endprocedure - -!unquoted procedure System_Boundary($alias, $label, $tags="", $link="") -Boundary($alias, $label, "System", $tags, $link) -!endprocedure diff --git a/base/C4_Deployment.puml b/base/C4_Deployment.puml deleted file mode 100644 index 4243cd5..0000000 --- a/base/C4_Deployment.puml +++ /dev/null @@ -1,164 +0,0 @@ -!include C4_Container.puml - -' Colors -' ################################## - -!global $NODE_FONT_COLOR = "#000000" -!global $NODE_BG_COLOR = "#FFFFFF" -!global $NODE_BORDER_COLOR = "#A2A2A2" - -' Styling -' ################################## - -UpdateElementStyle("node", $bgColor=$NODE_BG_COLOR, $fontColor=$NODE_FONT_COLOR, $borderColor=$NODE_BORDER_COLOR) -skinparam rectangle<> { - FontStyle normal -} - -' shortcuts with default colors -' node specific: $type reuses $techn definition of $tags -!unquoted procedure AddNodeTag($tagStereo, $bgColor=$NODE_BG_COLOR, $fontColor=$NODE_FONT_COLOR, $borderColor=$NODE_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="") - AddElementTag($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite) -!endprocedure - -' Layout -' ################################## - -' comment if node should not be added to legend. No calculated legend extension required -SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container\nnode") - -' Line breaks -' ################################## - -' PlantUML supports no automatic line breaks of "PlantUML containers" (C4 Deployment_Node is a "PlantUML container") -' therefore (Deployment_)Node() implements an automatic line break based on spaces (like in all other objects). -' If a $type contains \n then these are used (and no automatic space based line breaks are done) -' $NODE_TYPE_MAX_CHAR_WIDTH defines the automatic line break position -!global $NODE_TYPE_MAX_CHAR_WIDTH = 35 -!global $NODE_DESCR_MAX_CHAR_WIDTH = 32 - -!unquoted function $breakNode($type, $widthStr) -!$width = %intval($widthStr) -!$multiLine = "" -!if (%strpos($type, "\n") >= 0) - !while (%strpos($type, "\n") >= 0) - !$brPos = %strpos($type, "\n") - !$multiLine = $multiLine + %substr($type, 0, $brPos) + '\n' - !$type = %substr($type, $brPos+2) - !endwhile -!else - !while (%strlen($type) > $width) - !$brPos = $width - !while ($brPos > 0 && %substr($type, $brPos, 1) != ' ') - !$brPos = $brPos - 1 - !endwhile - - !if ($brPos < 1) - !$brPos = %strpos($type, " ") - !else - !endif - - !if ($brPos > 0) - !$multiLine = $multiLine + %substr($type, 0, $brPos) + '\n' - !$type = %substr($type, $brPos + 1) - !else - !$multiLine = $multiLine+ $type - !$type = "" - !endif - !endwhile -!endif -!if (%strlen($type) > 0) - !$multiLine = $multiLine + $type -!endif -!return $multiLine -!endfunction - -' Elements -' ################################## - -!function $getNode($label, $type, $descr, $sprite) - !$nodeText = "" - !if ($sprite != "") - !$nodeText = $nodeText + $getSprite($sprite) + '\n' - !endif - !$nodeText = $nodeText + '==' + $label - !if ($type != "") - !$nodeText = $nodeText + '\n[' + $breakNode($type, $NODE_TYPE_MAX_CHAR_WIDTH) + ']' - !endif - !if ($descr != "") - !$nodeText = $nodeText + '\n\n' + $breakDescr($descr, $NODE_DESCR_MAX_CHAR_WIDTH) - !endif - !return $nodeText -!endfunction - -!function $getNode_L($label, $type, $descr, $sprite) - !$nodeText = "" - !if ($sprite != "") - !$nodeText = $nodeText + $getSprite($sprite) + '\l' - !endif - !$nodeText = $nodeText + '==' + $label - !if ($type != "") - !$nodeText = $nodeText + '\l[' + $breakNode($type, $NODE_TYPE_MAX_CHAR_WIDTH) + ']' - !endif - !if ($descr != "") - !$nodeText = $nodeText + '\l\l' + $breakDescr($descr, $NODE_DESCR_MAX_CHAR_WIDTH) - !endif - !return $nodeText -!endfunction - -!function $getNode_R($label, $type, $descr, $sprite) - !$nodeText = "" - !if ($sprite != "") - !$nodeText = $nodeText + $getSprite($sprite) + '\r' - !endif - !$nodeText = $nodeText + '==' + $label - !if ($type != "") - !$nodeText = $nodeText + '\r[' + $breakNode($type, $NODE_TYPE_MAX_CHAR_WIDTH) + ']' - !endif - !if ($descr != "") - !$nodeText = $nodeText + '\r\r' + $breakDescr($descr, $NODE_DESCR_MAX_CHAR_WIDTH) - !endif - !return $nodeText -!endfunction - -!unquoted procedure Deployment_Node($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode($label, $type, $descr, $sprite)$getProps()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Deployment_Node_L($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_L($label, $type, $descr, $sprite)$getProps_L()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Deployment_Node_R($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_R($label, $type, $descr, $sprite)$getProps_R()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Node($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode($label, $type, $descr, $sprite)$getProps()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Node_L($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_L($label, $type, $descr, $sprite)$getProps_L()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure - -!unquoted procedure Node_R($alias, $label, $type="", $descr="", $sprite="", $tags="", $link="") -!$sprite=$toElementArg($sprite, $tags, "ElementTagSprite", "node") -' nodes $type reuses $techn definition of $tags -!$type=$toElementArg($type, $tags, "ElementTagTechn", "node") -rectangle "$getNode_R($label, $type, $descr, $sprite)$getProps_R()" $toStereos("node",$tags) as $alias $getLink($link) -!endprocedure diff --git a/base/C4_Dynamic.puml b/base/C4_Dynamic.puml deleted file mode 100644 index 8f4aeec..0000000 --- a/base/C4_Dynamic.puml +++ /dev/null @@ -1,141 +0,0 @@ -!include C4_Component.puml - -' Scope: Interactions in an enterprise, software system or container. -' Primary and supporting elements: Depends on the diagram scope - -' enterprise - people and software systems Related to the enterprise in scope -' software system - see system context or container diagrams, -' container - see component diagram. -' Intended audience: Technical and non-technical people, inside and outside of the software development team. - -' Dynamic diagram introduces (automatically) numbered interactions: -' (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) -' -' (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) - -' Index -' ################################## - -!$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 - -' Relationship override -' ################################## - -' Relationship -' ################################## - -!unquoted procedure Rel_($e_index, $alias1, $alias2, $label, $direction) -$alias1 $direction $alias2 : **$e_index: $label** -!endprocedure -!unquoted procedure Rel_($e_index, $alias1, $alias2, $label, $techn, $direction) -$alias1 $direction $alias2 : **$e_index: $label**\n//[$techn]// -!endprocedure - -!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-->>", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("-->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<--", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Back($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<--", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("->>", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Neighbor($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-", $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Back_Neighbor($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel("<<-", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_D($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Down($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($down("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_U($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Up($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($up("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_L($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Left($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($left("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure - -!unquoted procedure Rel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure Rel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, Index() + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_R($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure -!unquoted procedure RelIndex_Right($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="") -$getRel($right("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link) -!endprocedure diff --git a/readme.md b/readme.md index bd6a5bf..f5a181e 100644 --- a/readme.md +++ b/readme.md @@ -108,9 +108,12 @@ The script will try to install all the dependencies if not present but there mig ## Usage -1. Start with [C4](https://c4model.com/) diagrams using PlantUML. Follow the examples [Context](context.puml), [Container](container.puml) and [Component](component.puml) in this repo. +1. Start with [C4](https://c4model.com/) diagrams using PlantUML. Run the PlantUML server using `docker run --name plantuml -d -p 8089:8080 plantuml/plantuml-server:latest` (port 8089 to match `plantuml.server` in vscode settings). Follow the examples [Context](context.puml), [Container](container.puml) and [Component](component.puml) in this repo. Also check out the [samples](https://github.com/plantuml-stdlib/C4-PlantUML/tree/master/samples) in [C4-PlantUML](https://github.com/plantuml-stdlib/C4-PlantUML). C4-PlantUML is part of [plantuml's rich standard library](https://github.com/plantuml/plantuml-stdlib). + - To preview the diagrams : Open [VS Code Command Pallette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and Select `PlantUML : Preview current diagram` -3. End with system diagrams using [Diagrams](https://diagrams.mingrammer.com/). Follow the example [diagram](diagram.ipynb) in this repo. + - To generate images using terminal / shell scripts, download plantuml jar file from [github](https://github.com/plantuml/plantuml/releases) and use `java -jar plantuml.jar ...`, see [documentation](https://plantuml.com/command-line) for details. + +2. End with system diagrams using [Diagrams](https://diagrams.mingrammer.com/). Follow the example [diagram](diagram.ipynb) in this repo. - To preview simply `Run All` the Jupyter notebook from top toolbar

(back to top)

diff --git a/setup-macos.sh b/setup-macos.sh index 009637c..ee2455d 100644 --- a/setup-macos.sh +++ b/setup-macos.sh @@ -31,9 +31,9 @@ then exit fi -# run plantuml server -echo "docker run plantuml-server" -docker run -d -p 8089:8080 plantuml/plantuml-server:jetty +# pull plantuml server +echo "docker pull plantuml-server" +docker pull plantuml/plantuml-server:latest # install graphviz echo "install graphviz"