structurizr / dsl

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

Create dynamic view with starting parallel activities #172

Closed MTomBosch closed 1 year ago

MTomBosch commented 1 year ago

In this example I am trying to make the first two actions from "user" to be in parallel but somehow I cannot make it work. They are always sequential.

Where is the problem in my code?

workspace {

    model {
        user = person "User"
        softwareSystem = softwareSystem "Software System" {
            webapp = container "Web Application"
            bus = container "Message Bus"
            app1 = container "App 1"
            app2 = container "App 2"
        }

        user -> webapp "Updates details"
        user -> bus "Sends update event"
        bus -> app1 "Broadcasts update event"
        bus -> app2 "Broadcasts update event"
    }

    views {
        dynamic softwareSystem {
            user -> webapp
            {
                webapp -> app1
            }
            user -> bus
            {
                bus -> app1
            }
            autoLayout
        }
    }
}
simonbrowndotje commented 1 year ago

Perhaps this is what you're looking for?

workspace {

    model {
        user = person "User"
        softwareSystem = softwareSystem "Software System" {
            webapp = container "Web Application"
            bus = container "Message Bus"
            app1 = container "App 1"
            app2 = container "App 2"
        }

        user -> webapp "Updates details"
        user -> bus "Sends update event"
        bus -> app1 "Broadcasts update event"
        bus -> app2 "Broadcasts update event"
    }

    views {
        dynamic softwareSystem {
            {
                user -> webapp
                webapp -> app1
            }
            {
                user -> bus
                bus -> app1
            }
            autoLayout
        }
    }
}
MTomBosch commented 1 year ago

Yes, exactly. Thank you.

I have to admit that I am always struggling with the syntax and semantics of the dynamic view resp. the brackets since I am not using it so often.