[FEAT] Add new methods to only retrieve the BPMN semantic of elements in the model #2813
Labels
BPMN diagram usability
Something about the way we can interact with BPMN diagrams
decision record
Track project and architectural decisions
enhancement
New feature or request
Milestone
Is your feature request related to a problem? Please describe.
In v0.38.1, the
BpmnElementsRegistry
allows to retrieve elements of the model asBpmnSemantic
type with their associated graphical representation in the DOM. In a lot of cases, callers don’t need the graphical part and have to doIn this case, there is also extra processing on the bpmn-visualization side to get the
HTMLElement
(with query selectors).Describe the solution you'd like
I propose to introduce 2 new methods in
BpmnElementsRegistry
to retrieve only the semantic of the model elements. This will also cover a part of #2402Decision about the implementation of
getModelElementsByKinds
The existing
getElementsByKinds
retrieve the elements by first looking in the DOM, then get the BPMN Semantic.For the new method, if we don't want to check the DOM, this requires to have a way to search in the model. The existing search by ids used a Map in
SearchableModel
which is pre-computed after the model has been loaded. We could create a new one by kinds.As a first implementatoin, we decided with @csouchet to use the "DOM way". Having a new cache will impact all users (memory consumpting, time to pre-populate the cache) and we should ideally run tests and get metrics.
We don't want to do that for now (we don't have the test infrastructure to do it) and we prefer to impact only users that will use the new feature (if the DOM lookup has performance issues).
We may modify the implementation in the future depending on any feedback we receive.
Tasks
The text was updated successfully, but these errors were encountered: