-
-
Notifications
You must be signed in to change notification settings - Fork 318
Override relationships in deployment diagrams #334
-
I am looking for a way to override relationships in deployment views to display deployment specific information like host names, port numbers and so on. Can I somehow configure deployment views to behave more like dynamic views?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 2 replies
-
You can use the recently added !relationships feature to do this; for example:
workspace {
!identifiers hierarchical
model {
x = softwareSystem "X" {
a = container "A"
b = container "B"
a -> b "Makes API request to" "JSON/HTTPS"
}
live = deploymentEnvironment "Live" {
server1 = deploymentNode "Server1" {
aInstance = containerInstance x.a
}
server2 = deploymentNode "Server2" {
bInstance = containerInstance x.b
}
}
!relationships "live.server1.aInstance->live.server2.bInstance" {
properties {
port 8080
}
}
}
views {
deployment x live "Deployment-Live-X" {
include *
autolayout lr
}
}
}
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi Simon! Thank you very much for the answer. I had created a workaround using a groovy script along this idea:
workspace.model.relationshipsById.findAll{ it.value.getCanonicalName() =~ /Relationship:\/\/ContainerInstance:\/\/.*\/system1.app1\[1\] -> ContainerInstance:\/\/.*\/system1.app2\[1\]/ }.each{ it.value.technology = /bar/ }
It works quite nice, so I got a bit lazy about the topic. The new feature of course would make things more explicit. In your example, you set a property. Is it also possible the set description or technology for the diagram?
Beta Was this translation helpful? Give feedback.
All reactions
-
Perhaps I'm missing something obvious. The question is about changing the properties (including the description and technology) of a relationship in one deployment view, while keeping them different in other views. In a deployment view, for example, I may want the URL to be visible near the relationship rather than the 'uses' relation.
Both my Groovy workaround and your proposal regarding the '!relationship' feature modify the properties at the model level.
Beta Was this translation helpful? Give feedback.