Process Analytics - May 2023 News
Tags: news, bpmn, visualization, processmining
Published: 2023-06-02 10:00:00

Welcome to the Process Analytics monthly news 👋.

Our “always” reminder: The goal of the Process Analytics project is to provide a means to rapidly display meaningful Process Analytics components in your web pages using BPMN 2.0 notation and Open Source libraries.

In the blink of an eye, May whisked us away with an abundance of holidays (in France, May is the month of many long holiday weekends! 🤗). This month, we introduced new functionalities, including support for _BPMN in color_, which enables the rendering of color-modeled BPMN. We also updated our examples with the latest APIs and achieved a milestone with the publication of an article on integrating our bpmn-visualization library with pm4py.


## bpmn-visualization TypeScript library

In May, we released 3 versions: [0.34.0](https://github.com/process-analytics/bpmn-visualization-js/releases/tag/v0.34.0), [0.34.1](https://github.com/process-analytics/bpmn-visualization-js/releases/tag/v0.34.1) & [0.35.0](https://github.com/process-analytics/bpmn-visualization-js/releases/tag/v0.35.0). Below are some highlights of the main features of these versions. For more details, check out the release notes.


### _BPMN in Color_ specification now supported

The _BPMN in Color_ specification is a reference to define the colors of BPMN modeling elements. This specification is recommended for color exchange between BPMN modeling tools. More information about this specification is available in the [bpmn-miwg/bpmn-in-color](https://github.com/bpmn-miwg/bpmn-in-color) GitHub repository. 

In bpmn-visualization 0.35.0, support for _BPMN in Color_ was  introduced with a fallback to [bpmn.io-specific BPMN extensions for colors](https://github.com/bpmn-io/bpmn-moddle/blob/ea7fa6a94c55f49fe1da1f019dc9a40d62967252/resources/bpmn-io/json/bioc.json). 

Rendering of colors defined in the BPMN source is disabled by default. To enable _BPMN in Color_, use the following code snippet: 


```js
const bpmnVisualization = new BpmnVisualization({ 
            container: 'bpmn-container', 
            renderer: { ignoreBpmnColors: false }
});
```

![Rendering of the C.1.0 diagram when the "BPMN in Color" support is enable](https://user-images.githubusercontent.com/27200110/231206686-5109669a-79c5-4a35-bde4-a95b5f4f3017.png)


⏩ Want to test it live? Give it a try with the following examples: 


* [Load and navigation demo](https://cdn.statically.io/gh/process-analytics/bpmn-visualization-examples/v0.35.0/demo/load-and-navigation/index.html?renderer.ignore.bpmn.colors=false) 
* Example that [loads diagrams from miwg-test-suite](https://cdn.statically.io/gh/process-analytics/bpmn-visualization-examples/v0.35.0/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html). Load A.4.1 or C.1.0 for the instance.


### New API for CSS style reset

In earlier versions of bpmn-visualization, we provided functionality to remove specific classes from BPMN elements by specifying their IDs and class names, as demonstrated in the code snippet below:


```js
// Remove CSS classes from the BPMN elements in styledElements
bpmnVisualization.bpmnElementsRegistry
                 .removeCssClasses(styledElements, 
                                    ['highlight-info', 
                                     'highlight-success', 
                                     'highlight-error', 
                                     'highlight-warning']);
```

While this approach served its purpose in removing a portion of CSS classes, it became cumbersome when applications required a complete restoration of default rendering or a transition to an entirely different visualization. For example, in [our monitoring demo](https://cdn.statically.io/gh/process-analytics/bpmn-visualization-examples/v0.33.1/demo/monitoring-all-process-instances/index.html), switching from a frequency view to a time performance view, or in our [Bonita Day 2023 demo](https://process-analytics.github.io/bonita-day-demo-2023/), switching between different use cases necessitated a complete style reset.

With the release of bpmn-visualization 0.34.0, we introduced a new API called [removeAllCssClasses ](https://process-analytics.github.io/bpmn-visualization-js/api/classes/BpmnElementsRegistry.html#removeAllCssClasses)in the **BpmnElementsRegistry**. This API empowers users to effortlessly remove all CSS classes from BPMN elements. Take a look at the code snippet below:


```js
// Remove all CSS classes from the BPMN elements in styledElements
bpmnVisualization.bpmnElementsRegistry
                 .removeAllCssClasses(styledElements);
```

And if you wish to reset the CSS classes of all BPMN elements, you can simply call the function with no arguments:

```js
// Remove all CSS classes from all BPMN elements
bpmnVisualization.bpmnElementsRegistry.removeAllCssClasses();
```

## bpmn-visualization examples

We have updated the existing examples to showcase the enhancements of the latest functionalities. For a comprehensive overview of all the changes, please refer to the [examples 0.34.0 release notes](https://github.com/process-analytics/bpmn-visualization-examples/releases/tag/v0.34.0).

In particular, the monitoring demo now uses the [Update Style API](https://process-analytics.github.io/bpmn-visualization-js/api/classes/BpmnElementsRegistry.html#updateStyle) instead of the [CSS API](https://process-analytics.github.io/bpmn-visualization-js/api/classes/BpmnElementsRegistry.html#addCssClasses) to have a consistent stroke width even when zooming. Curious to explore the updated demo? Take a look at our ⏩ [live environment]
(https://cdn.statically.io/gh/process-analytics/bpmn-visualization-examples/v0.34.0/demo/monitoring-all-process-instances/index.html). 

The examples that allow users to play with the library, and that are running in the Live IDE, have been updated as well. Want to give it a try? ⏩ [live environment](https://cdn.statically.io/gh/process-analytics/bpmn-visualization-examples/v0.34.0/examples/index.html#miscellaneous).



![Screenshot from the codesandbox TypeScript environment](https://github.com/process-analytics/bpmn-visualization-js/assets/27200110/32e58b2f-a9e0-4a70-b28c-fa51bd151cb3)



## Sharing Key Insights from bpmn-visualization and pm4py Integration

We recently developed an [integration example](https://github.com/process-analytics/bpmn-visualization-pm4py) between bpmn-visualization and [pm4py](https://pm4py.fit.fraunhofer.de/). This example allows the user to discover a BPMN process model from process execution data and to compute various statistics using pm4py. The results are then displayed visually using our bpmn-visualization library. The figure below showcases an example of a BPMN process model enriched with frequency data obtained from process execution data sourced from the [process mining book](https://processmining.org/old-version/event-book.html). 


![Screenshot from the integration example showing a BPMN model with frequency data computed from execution data](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jqtev4ep62c5b160f0a6.png)


During the process, we encountered some limitations of the BPMN-based process mining approach we followed ⛔️. In our latest article, we delve into the high-level details of the integration and shed light on those limitations of BPMN-based visualization in process mining. Read more about it  👉  in our [Medium article](https://medium.com/@process-analytics/exploring-the-intersection-of-bpmn-with-process-mining-a5fd246625bf).


## That’s all folks! 

That's a wrap for this edition of our May project news! We hope you found it informative and enjoyable. Stay tuned for more exciting updates on the horizon! 👋

In the meantime, stay on top of the latest news and releases by following us:


* Website: [https://process-analytics.dev](https://process-analytics.dev/?utm_source=dev.to&utm_medium=display&utm_campaign=news)
* Twitter: [@ProcessAnalyti1](https://twitter.com/ProcessAnalyti1)
* GitHub: [https://github.com/process-analytics](https://github.com/process-analytics)
* Discord: [Join our server!](https://discord.com/invite/HafnBYsRXd)
* YouTube: [Process Analytics YouTube channel](https://www.youtube.com/@process-analytics)

_Cover photo by [Ricardo Gomez Angel](https://unsplash.com/photos/L6T_6Rp2iEk) on[ Unsplash](https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_