@@ -54,9 +54,47 @@ relationship.addTags(CRITICAL);
5454ContainerView view = workspace. getViews(). createContainerView(softwareSystem, " containerView" , " " );
5555view. addDefaultElements();
5656
57+ // use the ExtendedC4PlantUmlExporter instead of the default C4PlantUmlExporter
5758Diagram diagram = new ExtendedC4PlantUmlExporter (). export(view);
5859````
5960
60- and this will create the following diagram:
61+ and this will create the following PlantUML diagram:
62+
63+ ```` puml
64+ @startuml
65+ title SoftwareSystem - Containers
66+
67+ top to bottom direction
68+
69+ !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4.puml
70+ !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
71+ !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
72+
73+
74+ AddElementTag("Container", $bgColor="#efefef")
75+ AddElementTag("server", $bgColor="#00ff00", $fontColor="#ff00ff")
76+ AddElementTag("db", $bgColor="#ff00ff", $fontColor="#00ff00")
77+ AddRelTag("critical", $lineColor="#ff0000", $textColor="#ff0000", $lineStyle=DottedLine())
78+ System_Boundary("SoftwareSystem_boundary", "SoftwareSystem") {
79+ WithoutPropertyHeader()
80+ AddProperty("IP","127.0.0.1")
81+ AddProperty("Region","East")
82+ Container(SoftwareSystem.Container1, "Container 1", "", $tags="server+Container+Element")
83+ WithoutPropertyHeader()
84+ AddProperty("IP","127.0.0.2")
85+ AddProperty("Region","West")
86+ ContainerDb(SoftwareSystem.Container2, "Container 2", "", $tags="db+Container+Element")
87+ }
88+
89+ WithoutPropertyHeader()
90+ AddProperty("Prop1","Value1")
91+ AddProperty("Prop2","Value2")
92+ Rel_D(SoftwareSystem.Container1, SoftwareSystem.Container2, "fetches data", $tags="critical+Relationship")
93+
94+ SHOW_LEGEND()
95+ @enduml
96+ ````
97+
98+ which can be rendered to this image using PlantUML:
6199
62100![ Full Example] ( /fullExample.png )
0 commit comments