interface StyleRegistry {
    resetStyle(bpmnElementIds?): void;
    updateStyle(bpmnElementIds, styleUpdate): void;
}

Implemented by

Methods

  • Reset the style that were previously updated to one or more BPMN elements using the updateStyle method.

    Parameters

    • Optional bpmnElementIds: string | string[]

      The BPMN ID of the element(s) whose style must be reset. When passing a nullish parameter, the style of all BPMN elements will be reset. Passing an empty array has no effect.

    Returns void

    Example

    bpmnVisualization.bpmnElementsRegistry.resetStyle('activity_1');
    

    Notes:

    • This method is intended to update the style of specific elements, e.g. to update their colors. When rendering a BPMN diagram, bpmn-visualization applies style properties to all elements according to their types. So if you want to style all elements of a certain type, change the default configuration of the styles instead of updating the element afterward. See the repository providing the examples of the bpmn-visualization TypeScript library for more details.
    • 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.

    See

    Since

    0.37.0

  • Update the style of one or several BPMN elements.

    Parameters

    • bpmnElementIds: string | string[]

      The BPMN ID of the element(s) whose style must be updated.

    • styleUpdate: StyleUpdate

      The style properties to update.

    Returns void

    Example

    bpmnVisualization.bpmnElementsRegistry.updateStyle('activity_1', {
    stroke: {
    color: 'red',
    },
    });

    Notes:

    • This method is intended to update the style of specific elements, e.g. to update their colors. When rendering a BPMN diagram, bpmn-visualization applies style properties to all elements according to their types. So if you want to style all elements of a certain type, change the default configuration of the styles instead of updating the element afterwards. See the repository providing the examples of the bpmn-visualization TypeScript library for more details.
    • 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.

    See

    Since

    0.33.0