Closed chrikoch closed 2 months ago
StructurizrPlantUmlExporter
already has these lines
if (relationshipView.isResponse() != null && relationshipView.isResponse()) {
arrowStart = solid ? "<-" : "<.";
arrowEnd = solid ? "-" : ".";
} else {
arrowStart = solid ? "-" : ".";
arrowEnd = solid ? "->" : ".>";
}
which should more or less do what you expect.
So how can we make a RelationshipView
a response
?
Unfortunately that setter is package-private and right now only be called in DynamicView
, which is not what you need here - I'm sure @simonbrowndotje can help here, it's a more fundamental question if and how use response relationships should be available in static diagrams as well.
Yeah, that should solve my problem. However it's also not a perfect solution, as technically it is no response relationship, but simply a relation for another use case where the control flow is the other way around.
Actually, it would only be a workaround for a shortcoming in PlantUML :-( But I don't expect it to get fixed there.
As you said in your PlantUML forum post, even this basic example doesn't work:
@startuml
rectangle "1" {
component A
}
rectangle "2" {
component B
}
A -> B: request
B -> A: response
@enduml
So I suggest modifying the plantUML exporter, so that the elements are alphabetically ordered for example and the "smaller" element is always on the left (and changing the relation from > to < if necessary).
This sounds overly complicated, and not something I want to add. It needs to be fixed in PlantUML really.
Description
I know bidirectional relationships are not encouraged, but I have a scenario where two services call each other in different cases (
A->B
is http whileB->A
is Kafka), so I decided to model both relations. In the resulting diagram the relations are now rendered over each other so they can't be clearly read anymore.I figured out this minimal example:
When exporting this to plantUML and rendering it via
the result is this where the relations between A2 and B2 are unreadable:
As I figured out with plantUML (see https://forum.plantuml.net/19140/overlapping-arrows-when-components-are-in-rectangles?show=19141#a19141) this can be solved by changing this line in the puml file
to
So having A.A2 on the left. Then the result is like this:
So I suggest modifying the plantUML exporter, so that the elements are alphabetically ordered for example and the "smaller" element is always on the left (and changing the relation from > to < if necessary).
Priority
I have no budget and there's no rush, please add this feature for free
More information
No response