structurizr / dsl

Structurizr DSL
https://docs.structurizr.com/dsl
Apache License 2.0
1.41k stars 265 forks source link

Exclude relationship behaviour doesn't work as expected when there are multiple implied relationships #306

Closed max-arshinov closed 1 year ago

max-arshinov commented 1 year ago

Description

This is a follow-up for https://github.com/structurizr/dsl/issues/303. It looks like Structurizr always selects the first relationship as an implied relationship, even when this relationship is excluded.

Steps to reproduce

  1. Create a workspace using a code example below

Expected behaviour

Actual behaviour

Screenshot

image

Code sample

workspace {
    model {
        customer = person "User"

        system1 = softwareSystem "System 1" {
            container1 = container "Container 1"
            container2 = container "Container 2"
        }

        system2 = softwareSystem "System 2" {
            container3 = container "Container 1"
            container4 = container "Container 2"
        }

        r1 = container3 -> container1 "3 -> 1"
        r2 = container4 -> container2 "4 -> 2"
    }   

    views {
        systemContext system1 {
            include system1 system2
            exclude r1
            include r2
            autolayout
        }
        theme default
    }
}

Configuration

No response

Severity

Major

Priority

Medium

Resolution

I have no budget, please fix this for free

More information

No response

simonbrowndotje commented 1 year ago

This is as expected; see https://github.com/structurizr/dsl/tree/master/docs/cookbook/implied-relationships#multiple-implied-relationships for an explanation.

max-arshinov commented 1 year ago

Even if I explicitly excluded the first relationship from the view?