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
215 stars 29 forks source link

[FEAT] Provide a way to style BPMN traces/paths #930

Open tbouffard opened 3 years ago

tbouffard commented 3 years ago

Is your feature request related to a problem? Please describe. BPMN path or trace definition: this is something similar to the Path in the graph theory

This can be all edges from the process instance start to the current execution points (BPMN Shape) for the instance (can be an end event if the instance is completed). It may also contains the verticles (aka BPMN shapes) if the integration wants to apply the same style to all elements or only the verticles.

So, the exact content of the path ultimately depends of the styling to be applied.

Current capabilities As a first step, integrations can pass all the elements of the path they want to style. This may be done by #927 (this is what the https://github.com/process-analytics/bpmn-visualization-examples/pull/114 example currently uses) or a new dedicated API focussed on applying styles (#942). Paths are generally know by retrieving runtime/execution data, so integration should be able to pass this information to bpmn-visualization.

Describe the solution you'd like

  1. Provide only the edges or the shapes of the path (in the order they occurred at execution time or not): this is very common to only have the task/flownodes execution data in logs and not the transitions. So we should provide one of the following:

  2. Provide the 1st and the last elements of the path and compute the whole path. This is something related to the Graph Theory, so we probably won't implement this ourself but delegate this to something implementing dedicated Graph algorithm. In that case, we may need to provide an API to navigate into the internal Bpmn Model to rebuild the Graph (some information may already available with #929). The integration retrieve the Bpmn Model info, pass them to an external Graph library to compute the path. Then the integration pass the result of the graph computation to bpmn-visualization for path highlighting. The following issues will help: https://github.com/process-analytics/bv-experimental-add-ons/issues?q=is%3Aissue+is%3Aopen+PathResolver+sort%3Aupdated-desc

tbouffard commented 1 year ago

https://github.com/process-analytics/bv-experimental-add-ons/releases/tag/v0.1.0 provides a first implementation of PathResolver that already covers some items described in this issue. PathResolver will be improved in the future to implement all use-cases described here, see https://github.com/process-analytics/bv-experimental-add-ons/issues?q=is%3Aissue+is%3Aopen+PathResolver