Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Override relationships in deployment diagrams #334

Unanswered
mathias-muench asked this question in Q&A
Discussion options

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?

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

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
 }
 }
}
You must be logged in to vote
2 replies
Comment options

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?

Comment options

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /