bpmn-visualization-js
bpmn-visualization-js copied to clipboard
[FEAT] Provide a way to style BPMN traces/paths
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
- 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:
- let get the incoming/outgoing edges from a single or a list of shapes (#2504)
- let only pass the shapes/flownodes information and bpmn-visualization also highlight related edges. Internally, we know what are the incoming/outgoing edges of a shape and the source/target of an edge so we could recompute the BPMN elements of the path that have not been provided. https://github.com/process-analytics/bonita-day-demo-2023/issues/36 and https://github.com/process-analytics/bonita-day-demo-2023/issues/120 will help
- 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
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