structurizr / dsl

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

enableAutomaticLayout fails on large number of view objects. #280

Closed psacchitella closed 1 year ago

psacchitella commented 1 year ago

Description

When I use the following script code !script groovy { workspace.views.views.each { it.enableAutomaticLayout(com.structurizr.view.AutomaticLayout.RankDirection.TopBottom, 300, 300, 400, false) } } after a filtered view it I get the following error. com.structurizr.lite.web.ApiController : com.structurizr.lite.web.ApiException: workspace.dsl: Error running inline script, caused by javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: com.structurizr.view.FilteredView.enableAutomaticLayout() is applicable for argument types: (com.structurizr.view.AutomaticLayout$RankDirection, Integer, Integer...) values: [TopBottom, 300, 300, 400, false] at line 88: } at line 438: !include views/view.dsl

Steps to reproduce

  1. Use workspace.views.views.each { it.enableAutomaticLayout(com.structurizr.view.AutomaticLayout.RankDirection.TopBottom, 300, 300, 400, false) } after
  2. filtered "kafkaTopicsC" include "Element,Relationship" "topics"

Screenshot

No response

Code sample

component kafkaTopics "kafkaTopicsC" "Kafka Topics"{
        include *
        // autolayout lr
    }
    filtered "kafkaTopicsC" include kafkaClips KafkaClipsView "clips" 
    filtered "kafkaTopicsC" include "Element,Relationship" "topics"
    filtered "kafkaTopicsC" include "Element,Relationship" "timelines"

Configuration

No response

Severity

Minor

Priority

Low

Resolution

I have no budget, please fix this for free

More information

I can skip the filtered views. It is annoying but being able to use the workspace.views.views.each { it.enableAutomaticLayout(com.structurizr.view.AutomaticLayout.RankDirection.TopBottom, 300, 300, 400, false) } Really makes a difference in our larger diagrams. Cheers, Phil