Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Hide a relationship in a view #7

Closed
tommysanterre opened this issue Sep 19, 2020 · 6 comments
Closed

Hide a relationship in a view #7

tommysanterre opened this issue Sep 19, 2020 · 6 comments

Comments

@tommysanterre
Copy link
Contributor

tommysanterre commented Sep 19, 2020

I have a system with slightly different component based on the deployed configuration.
Depending on the configuration certain component may lose responsibilities that I want to illustrate with relationship.
Is it possible to exclude a relationship from a view?

workspace  {

    model {
        mySystem = softwareSystem "My system" {
            componentA = container "A"
            componentB = container "B"
        }
        
        otherSystem = softwareSystem "The other system"
        
        componentA -> componentB "Do it for me"
        componentB -> otherSystem "Do it"
        componentA -> otherSystem "No B i'll do it myself"
    }

    views {
        container mySystem "ConfigurationA" {
            include *
            # Error The element/relationship "->" does not exist at line 20: exclude componentA -> otherSystem
            # exclude componentA -> otherSystem
            autoLayout
        }
        
        container mySystem "ConfigurationB" {
            include *
            exclude componentB
            autoLayout
        }
    }
}
@simonbrowndotje
Copy link
Contributor

Yes, you can assign an identifier to the relationship, and exclude that. For example:

workspace  {

    model {
        mySystem = softwareSystem "My system" {
            componentA = container "A"
            componentB = container "B"
        }
        
        otherSystem = softwareSystem "The other system"
        
        componentA -> componentB "Do it for me"
        componentB -> otherSystem "Do it"
        rel = componentA -> otherSystem "No B i'll do it myself"
    }

    views {
        container mySystem "ConfigurationA" {
            include *
            exclude rel
            autoLayout
        }
        
        container mySystem "ConfigurationB" {
            include *
            exclude componentB
            autoLayout
        }
    }
}

@tommysanterre
Copy link
Contributor Author

Oh I see. Awesome. Thanks!

@simonbrowndotje
Copy link
Contributor

You're welcome!

@florianmutter
Copy link

Does it also work the otherway round? Exclude all relationships except the ones that are in include?

@simonbrowndotje
Copy link
Contributor

It doesn't. Relationships are automatically added based upon the elements in the view.

@radekwlsk
Copy link

radekwlsk commented Jan 20, 2023

@simonbrowndotje Just letting you know that it does not work for Deployment Diagram, where it could be the most useful when load balancers, proxies etc. are used to pass the flow between containers.
One caveat may be that I am trying to hide a relation from container to component of another container where on the deployment only containers are used.

Should I open an issue or is there another option to do it for deployment?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants