Skip to content

->container-> expression does not work as expected in deployment view #347

@telune

Description

@telune

Expected

When I define a deployment view, and I use element expressions to include elements, I would expect all element expressions to work.

Actual

If I use element expressions to include the specific element I want, afferent and efferent couplings are not shown; however, they are shown if I include the element I want via a tag.

Steps to reproduce

Here is a sample workspace to illustrate the bug:

workspace "deploymentDiagramBug" {

  !identifiers hierarchical

  model {
    # Software Systems
    ss = softwareSystem "Sample Software System" "" {
      sc1 = container "Sample Container 1" "Does something interesting with 1" "" "TAG1"
      sc2 = container "Sample Container 2" "Does something interesting with 2" "" "TAG2"
    }
    
    # Relationships
    ss.sc1 -> ss.sc2 "Sends data from 1 to 2"
    ss.sc2 -> ss.sc1 "Sends data from 2 to 1"
    
    # Deployment environments
    prod = deploymentEnvironment "Production" {
      softwareSystemNode = deploymentNode "Software System Deployment Infrastructure" {
        sc1_vm = deploymentNode "SC1 VM" "" "" {
          sc1_instance = containerInstance ss.sc1
        }
        sc2_vm = deploymentNode "SC2 VM" "" "" {
          sc2_instance = containerInstance ss.sc2
        }
      }
    }
  }

  views {
    deployment ss prod "SC1DeploymentProdViewBug1" "SC1 Deployment View (BUGGED 1)" {
      include "->ss.sc1->"
      autolayout tb
    }
    deployment ss prod "SC1DeploymentProdViewBug2" "SC1 Deployment View (BUGGED 2)" {
      include "element==->ss.sc1->"
      autolayout tb
    }
    deployment ss prod "SC1DeploymentProdViewWork" "SC1 Deployment View (WORKING)" {
      include "->element.tag==TAG1->"
      autolayout tb
    }

    theme default
  }
}

Both "SC1DeploymentProdViewBug1" and "SC1DeploymentProdViewBug2" do not show afferent and efferent couplings:

image

While "SC1DeploymentProdViewWork" shows afferent and efferent couplings:

image

Version/build information

I am using Structurizr Lite version 2024.09.19, taken from Docker Hub (docker.io/structurizr/lite:2024.09.19)

Severity

Minor

Priority

I have no budget and there's no rush, please fix this for free

More information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions