bpmn-io / bpmn-js-element-templates

The element template extension for bpmn-js
MIT License
5 stars 3 forks source link

Enforce unique `id` properties #79

Closed nikku closed 5 months ago

nikku commented 6 months ago

Is your feature request related to a problem? Please describe.

The property#id fields and group#id fields are meant to uniquely identify certain elements in an element template.

The property#id field specifically identifies an element template property in order to be able to depend on it in other fields conditions. We've seen evidence that users misuse it and as a result our tooling blows up (https://github.com/bpmn-io/bpmn-js-element-templates/issues/78).

Describe the solution you'd like

Describe alternatives you've considered

Make our tooling completely fail-safe in the presence of non-unique property#id.

Additional context

Found here, reported to consumer here.

nikku commented 6 months ago

This should be supported via JSONSchema#draft-7 - https://github.com/json-schema-org/json-schema-vocabularies/issues/22.

nikku commented 6 months ago

We'd carefully need to evaluate if this is even feasible. One thing we could assert at run-time is that at any given time only one element with a given ID must be present. At this stage duplicate IDs are used, and serve a value for some consumers (Connectors).

nikku commented 5 months ago

We'll not be able to introduce this (anymore), as it will break loads of user land extensions.