Skip to content

Support observing changes (at least to model) #302

Open
@mwhipple

Description

@mwhipple

Description

Currently scripts/plugins seem to be applied to the current state and therefore need to be run at appropriate time(s), but it could be valuable to define behaviors that should work across time to avoid that sequencing and enable easier reuse (i.e. defining such behavior in a base workspace). For example some basic pseudo code of:

!script kotlin {
  workspace.model.onElementAdded { el ->
    if (el is com.structurizr.model.GroupableElement) el.addTags(el.group)
  }
}

Support for adding would seem helpful since it would presumably work with the DSL but I'm not sure about practical use for observing other types of changes since they would presumably be done programmatically anyway.
Adding this on Model seems valuable, I could imagine it being useful on ViewSet (not sure about any others).

Priority

I'm willing to add this feature myself and raise a PR (please confirm approach first)

More information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions