The BPMN ID of the element(s) to add the CSS classes to. Passing a nullish parameter or an empty array has no effect.
The name of the class(es) to add to the BPMN element(s).
// Add 'success-path' to BPMN elements with id: flow_1 and flow_5
bpmnVisualization.bpmnElementsRegistry.addCssClasses(['flow_1', 'flow_5'], 'success-path');
// Add 'suspicious-path' and 'additional-info' to BPMN element with id: task_3
bpmnVisualization.bpmnElementsRegistry.addCssClasses('task_3', ['suspicious-path', 'additional-info']);
Remove any CSS classes that were previously added to one or more BPMN elements using the addCssClasses or the toggleCssClasses methods.
Note: If you pass IDs that are not related to existing BPMN elements, they will be ignored and no changes will be made to the rendering.
Optional
bpmnElementIds: string | string[]The BPMN ID of the element(s) from which to remove all CSS classes. When passing a nullish parameter, all CSS classes associated with all BPMN elements will be removed. Passing an empty array has no effect.
// Remove all CSS classes from all BPMN elements
bpmnVisualization.bpmnElementsRegistry.removeAllCssClasses();
// Remove all CSS classes from BPMN elements with ID: activity_1 and activity_2
bpmnVisualization.bpmnElementsRegistry.removeAllCssClasses(['activity_1', 'activity_2']);
// Remove all CSS classes from BPMN element with ID: task_3
bpmnVisualization.bpmnElementsRegistry.removeAllCssClasses('task_3');
removeCssClasses to remove specific classes from a BPMN element.
Remove one or more CSS classes that were previously added to one or more BPMN elements using the addCssClasses or the toggleCssClasses methods.
Note: If you pass IDs that are not related to existing BPMN elements, they will be ignored and no changes will be made to the rendering.
The BPMN ID of the element(s) from which to remove the CSS classes. Passing a nullish parameter or an empty array has no effect.
The name of the class(es) to remove from the BPMN element(s).
// Remove 'highlight' from BPMN elements with ID: activity_1 and activity_2
bpmnVisualization.bpmnElementsRegistry.removeCssClasses(['activity_1', 'activity_2'], 'highlight');
// Remove 'running' and 'additional-info' from BPMN element with ID: task_3
bpmnVisualization.bpmnElementsRegistry.removeCssClasses('task_3', ['running', 'additional-info']);
removeAllCssClasses to remove all CSS classes from a BPMN element.
Toggle one or more CSS classes on one or more BPMN elements.
Note: If an ID is passed that does not reference an existing BPMN element, its reference is retained in the registry, but no rendering changes are made.
The BPMN ID of the element(s) on which to toggle the CSS classes. Passing a nullish parameter or an empty array has no effect.
The name of the class(es) to toggle on the BPMN element(s).
// Toggle 'highlight' for BPMN elements with ID: activity_1 and activity_2
bpmnVisualization.bpmnElementsRegistry.toggleCssClasses(['activity_1', 'activity_2'], 'highlight');
// Toggle 'running' and 'additional-info' for BPMN element with ID: task_3
bpmnVisualization.bpmnElementsRegistry.toggleCssClasses('task_3', ['running', 'additional-info']);
Add one or more CSS classes to one or more BPMN elements.
Notes:
bpmn-visualization
sets specific CSS classes to all elements based on their types.Activity
and aTask
. So it has thebpmn-type-activity
and thebpmn-type-task
classes. It shares these classes with all types ofTasks
.bpmn-service-task
to distinguish it from a BPMN User Task which has abpmn-user-task
.bpmn-label
classes.See the repository providing the examples of the
bpmn-visualization
TypeScript library for more details.