process-analytics / bpmn-visualization-js

A TypeScript library for visualizing process execution data on BPMN diagrams
https://process-analytics.github.io/bpmn-visualization-js/
Apache License 2.0
224 stars 30 forks source link

[FEAT] Add a new experimental API to get a edge/node by name #2453

Closed csouchet closed 1 year ago

csouchet commented 1 year ago

Currently, we only provides APIs that take BPMN element ids as parameters. However, there are scenario where the ids in the BPMN diagram have been generated and are unknown by the application. Instead, the app knows the name of the elements. So having APIs that take element names as parameter will allow such application to better interact with the diagram.

Use cases that require the new API

We may need https://github.com/process-analytics/bpmn-visualization-js/issues/953 to implement this request.

Important name

While the BPMN spec enforce unique ids, there is no guarantee that the names are unique in the diagram. So, when several elements have the same name, we will have to choose one or generate an error. This needs to be clarified prior starting the implementation. In any case, this should be explicit in the API documentation.

tbouffard commented 1 year ago

As part of https://github.com/process-analytics/bonita-day-demo-2023/pull/10, I have introduced an object (internal to the demo) in charge of retrieving the corresponding BPMN element or id given a name. It does the job with what is publicly available in bpmn-visualization, there may be performance issues and it doesn't include tests. So, consider it as extra experimental.

I plan to later extract it into a dedicated experimental npm package for reuse at least in other demos. It will also help to iterate on this feature, challenge the API and the implementation. Automatic tests will be implemented at that time.

csouchet commented 1 year ago

Duplicated with #14 ?

tbouffard commented 1 year ago

Duplicated with #14 ?

I don't understand, I gess you mean another issue number? The currently mentioned issue is about "Validate that the library performs better than Bonita Enterprise visualization" Did you mean https://github.com/process-analytics/bpmn-visualization-pm4py/issues/14?

tbouffard commented 1 year ago

Available as experimental add-ons in https://github.com/process-analytics/bv-experimental-add-ons/releases/tag/v0.1.0