Skip to content
This repository was archived by the owner on Dec 23, 2023. It is now read-only.
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
6 changes: 3 additions & 3 deletions Structurizr.PlantUML.Tests/IO/PlantUML/PlantUMLWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void test_writeWorkspace()
" component \"Web Application\" <<Container>> as 7" + Environment.NewLine +
"}" + Environment.NewLine +
"4 ..> 1 : Delivers e-mails to" + Environment.NewLine +
"1 ..> 7 : Uses <<HTTP>>" + Environment.NewLine +
"1 ..> 7 : <<HTTP>>" + Environment.NewLine +
"7 ..> 8 : Reads from and writes to <<JDBC>>" + Environment.NewLine +
"7 ..> 4 : Sends e-mail using" + Environment.NewLine +
"@enduml" + Environment.NewLine +
Expand Down Expand Up @@ -176,7 +176,7 @@ public void test_writeContainerView()
" component \"Web Application\" <<Container>> as 7" + Environment.NewLine +
"}" + Environment.NewLine +
"4 ..> 1 : Delivers e-mails to" + Environment.NewLine +
"1 ..> 7 : Uses <<HTTP>>" + Environment.NewLine +
"1 ..> 7 : <<HTTP>>" + Environment.NewLine +
"7 ..> 8 : Reads from and writes to <<JDBC>>" + Environment.NewLine +
"7 ..> 4 : Sends e-mail using" + Environment.NewLine +
"@enduml" + Environment.NewLine +
Expand Down Expand Up @@ -273,7 +273,7 @@ private void PopulateWorkspace()

Container webApplication = softwareSystem.AddContainer("Web Application", "", "");
Container database = softwareSystem.AddContainer("Database", "", "");
user.Uses(webApplication, "Uses", "HTTP");
user.Uses(webApplication, null, "HTTP");
webApplication.Uses(database, "Reads from and writes to", "JDBC");
webApplication.Uses(emailSystem, "Sends e-mail using");

Expand Down
21 changes: 15 additions & 6 deletions Structurizr.PlantUML/IO/PlantUML/PlantUMLWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,23 @@ private void Write(Relationship relationship, TextWriter writer)
{
try
{
writer.WriteLine(
String.Format("{0} ..> {1} {2}{3}",
// Write the relationship
writer.Write(
String.Format("{0} ..> {1}",
relationship.Source.Id,
relationship.Destination.Id,
HasValue(relationship.Description) ? ": " + relationship.Description : "",
HasValue(relationship.Technology) ? " <<" + relationship.Technology + ">>" : ""
)
relationship.Destination.Id)
);
// Check if the relationship needs a label
if (HasValue(relationship.Description) || HasValue(relationship.Technology))
{
writer.Write(
String.Format(": {0}{1}",
HasValue(relationship.Description) ? ": " + relationship.Description : "",
HasValue(relationship.Technology) ? " <<" + relationship.Technology + ">>" : "")
);
}
// Add a newline
writer.WriteLine("");
}
catch (IOException e)
{
Expand Down