Skip to content

0.7.0

Latest
Compare
Choose a tag to compare
@process-analytics-bot process-analytics-bot released this 06 Sep 13:16
· 11 commits to main since this release

Exciting New Features in this Release!

Check out the full list of issues here: Milestone 0.7.0

🚀 Highlights

🎨 New Plugin: StyleByNamePlugin

In bpmn-visualization, BPMN elements are identified by their unique IDs. However, in some cases (like "Process Discovery"), only the element names are available to applications.

Previously, the BpmnElementsSearcher was introduced to retrieve an element's ID by name, allowing the use of existing bpmn-visualization APIs. With this release, the new StyleByNamePlugin simplifies things! Now, you can directly style elements using their names, mirroring the functionality of StyleRegistry.

Before:

const bpmnVisualization = new BpmnVisualization({
  container: 'bpmn-container',
});

const bpmnElementsRegistry = bpmnVisualization.bpmnElementsRegistry;
const searcher = new BpmnElementsSearcher(bpmnElementsRegistry);

// Update the style of a given element
const bpmnElementId = searcher.getElementIdByName('element-name');
bpmnElementsRegistry.updateStyle(bpmnElementId, styleUpdate);

// Updating the style of multiple elements was even more complex
const bpmnElementIds = searcher.searcher.getElementsByNames(['element-name-1', 'element-name-2'])
                                        .map(bpmnElement => bpmnElement.id);
bpmnElementsRegistry.updateStyle(bpmnElementIds, styleUpdate);

Now:

const bpmnVisualization = new BpmnVisualization({
  container: 'bpmn-container',
  plugins: [StyleByNamePlugin], // register the plugin
});

const styleByNamePlugin = bpmnVisualization.getPlugin<StyleByNamePlugin>('style');

// Update the style of a given element
styleByNamePlugin.updateStyle('element-name', styleUpdate);
// Update the style of multiple elements
styleByNamePlugin.updateStyle(['element-name-1', 'element-name-2'], styleUpdate);

✨ This streamlined approach significantly reduces complexity when working with element names!

📣 More name-based plugins are coming soon: 🎉

🛠️ Introducing Specialized Plugins

This version also introduces several new plugins, breaking down the BpmnElementsRegistry API into focused, interface-specific components:

  • CssClassesPlugin mirrors CssClassesRegistry
  • OverlaysPlugin mirrors OverlaysRegistry
  • StylePlugin mirrors StyleRegistry

These plugins hint at the future direction of bpmn-visualization, where the BpmnElementsRegistry will be split into more specialized APIs.

ℹ️ For further details, visit Issue #77

What's Changed

🎉 New Features

🐛 Bug Fixes

📝 Documentation

  • docs: improve BpmnElementsSearcher documentation by @tbouffard in #221

⚙️ Other Changes

Full Changelog: v0.6.1...v0.7.0