C4_Container.puml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. ' convert it with additional command line argument -DRELATIVE_INCLUDE="relative/absolute" to use locally
  2. !if %variable_exists("RELATIVE_INCLUDE")
  3. !include ./C4_Context.puml
  4. !else
  5. !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
  6. !endif
  7. ' Scope: A single software system.
  8. ' Primary elements: Containers within the software system in scope.
  9. ' Supporting elements: People and software systems directly connected to the containers.
  10. ' Intended audience: Technical people inside and outside of the software development team; including software architects, developers and operations/support staff.
  11. ' Colors
  12. ' ##################################
  13. !$CONTAINER_FONT_COLOR ?= $ELEMENT_FONT_COLOR
  14. !$CONTAINER_BG_COLOR ?= "#438DD5"
  15. !$CONTAINER_BORDER_COLOR ?= "#3C7FC0"
  16. !$CONTAINER_BOUNDARY_COLOR ?= $BOUNDARY_COLOR
  17. !$CONTAINER_BOUNDARY_BG_COLOR ?= $BOUNDARY_BG_COLOR
  18. !$CONTAINER_BOUNDARY_BORDER_STYLE ?= $BOUNDARY_BORDER_STYLE
  19. !$EXTERNAL_CONTAINER_FONT_COLOR ?= $ELEMENT_FONT_COLOR
  20. !$EXTERNAL_CONTAINER_BG_COLOR ?= "#B3B3B3"
  21. !$EXTERNAL_CONTAINER_BORDER_COLOR ?= "#A6A6A6"
  22. ' Labels
  23. ' ##################################
  24. !$CONTAINER_LEGEND_TEXT ?= "container"
  25. !$CONTAINER_BOUNDARY_TYPE ?= "container"
  26. !$CONTAINER_BOUNDARY_LEGEND_TEXT ?= "container boundary"
  27. !$EXTERNAL_CONTAINER_LEGEND_TEXT ?= "external container"
  28. ' Styling
  29. ' ##################################
  30. UpdateElementStyle("container", $CONTAINER_BG_COLOR, $CONTAINER_FONT_COLOR, $CONTAINER_BORDER_COLOR, $shape=$DEFAULT_SHAPE, $legendText="$CONTAINER_LEGEND_TEXT")
  31. UpdateElementStyle("external_container", $EXTERNAL_CONTAINER_BG_COLOR, $EXTERNAL_CONTAINER_FONT_COLOR, $EXTERNAL_CONTAINER_BORDER_COLOR, $shape=$DEFAULT_SHAPE, $legendText="$EXTERNAL_CONTAINER_LEGEND_TEXT")
  32. UpdateBoundaryStyle("container", $bgColor=$CONTAINER_BOUNDARY_BG_COLOR, $fontColor=$CONTAINER_BOUNDARY_COLOR, $borderColor=$CONTAINER_BOUNDARY_COLOR, $type="$CONTAINER_BOUNDARY_TYPE", $shape=$DEFAULT_SHAPE, $legendText="$CONTAINER_BOUNDARY_LEGEND_TEXT")
  33. ' shortcuts with default colors
  34. !unquoted procedure AddContainerTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="")
  35. $addElementTagInclReuse("container", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness)
  36. !endprocedure
  37. !unquoted procedure AddExternalContainerTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="", $borderStyle="", $borderThickness="")
  38. $addElementTagInclReuse("external_container", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $techn, $legendText, $legendSprite, $borderStyle, $borderThickness)
  39. !endprocedure
  40. !unquoted procedure UpdateContainerBoundaryStyle($bgColor=$CONTAINER_BOUNDARY_BG_COLOR, $fontColor=$CONTAINER_BOUNDARY_COLOR, $borderColor=$CONTAINER_BOUNDARY_COLOR, $shadowing="", $shape="", $type="Container", $legendText="", $borderStyle="", $borderThickness="", $sprite="", $legendSprite="")
  41. UpdateBoundaryStyle("container", $bgColor, $fontColor, $borderColor, $shadowing, $shape, $type, $legendText, $borderStyle, $borderThickness, $sprite, $legendSprite)
  42. !endprocedure
  43. ' Layout
  44. ' ##################################
  45. SetDefaultLegendEntries("person\nsystem\ncontainer\nexternal_person\nexternal_system\nexternal_container\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary")
  46. !procedure LAYOUT_WITH_LEGEND()
  47. hide stereotype
  48. legend right
  49. |<color:$LEGEND_TITLE_COLOR>**Legend**</color> |
  50. |<$PERSON_BG_COLOR> person |
  51. |<$SYSTEM_BG_COLOR> system |
  52. |<$CONTAINER_BG_COLOR> container |
  53. |<$EXTERNAL_PERSON_BG_COLOR> external person |
  54. |<$EXTERNAL_SYSTEM_BG_COLOR> external system |
  55. |<$EXTERNAL_CONTAINER_BG_COLOR> external container |
  56. endlegend
  57. !endprocedure
  58. ' Elements
  59. ' ##################################
  60. !unquoted procedure Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
  61. $getElementLine($baseShape , "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
  62. !endprocedure
  63. !unquoted procedure ContainerDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
  64. $getElementLine("database", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
  65. !endprocedure
  66. !unquoted procedure ContainerQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
  67. $getElementLine("queue", "container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
  68. !endprocedure
  69. !unquoted procedure Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $baseShape="rectangle")
  70. $getElementLine($baseShape , "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
  71. !endprocedure
  72. !unquoted procedure ContainerDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
  73. $getElementLine("database", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
  74. !endprocedure
  75. !unquoted procedure ContainerQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
  76. $getElementLine("queue", "external_container", $alias, $label, $techn, $descr, $sprite, $tags, $link)
  77. !endprocedure
  78. ' Boundaries
  79. ' ##################################
  80. !unquoted procedure Container_Boundary($alias, $label, $tags="", $link="", $descr = "")
  81. !if ($tags != "")
  82. !$allTags = $tags + '+container'
  83. !else
  84. !$allTags = 'container'
  85. !endif
  86. ' $type defined via $tag style
  87. Boundary($alias, $label, "", $allTags, $link, $descr)
  88. !endprocedure