bpmn-visualization API Documentation
    Preparing search index...

    Interface OverlaysRegistry

    interface OverlaysRegistry {
        addOverlays(bpmnElementId: string, overlays: Overlay | Overlay[]): void;
        removeAllOverlays(bpmnElementId: string): void;
    }

    Implemented by

    Index

    Methods

    • Add one/several overlays to a BPMN element.

      Notice that if you pass an id that is not related to an existing BPMN element, nothing happens on the rendering side.

      Parameters

      • bpmnElementId: string

        The BPMN id of the element where to add the overlays

      • overlays: Overlay | Overlay[]

        The overlays to add to the BPMN element

      Returns void

      // Add an overlay to BPMN elements with id 'task_1'
      bpmnVisualization.bpmnElementsRegistry.addOverlays('task_1', {
      position: 'top-left',
      label: '40',
      style: {
      font: { color: 'Chartreuse', size: 8 },
      fill: { color: 'Pink', opacity: 50 },
      stroke: { color: 'DarkSeaGreen', width: 2 }
      }
      });

      // Add several overlays to BPMN element with id 'task_3'
      bpmnVisualization.bpmnElementsRegistry.addOverlays('task_3', [
      {
      position: 'bottom-right',
      label: '110',
      style: {
      font: { color: '#663399', size: 8 },
      fill: { color: '#FFDAB9', opacity: 50 },
      stroke: { color: 'DarkSeaGreen', width: 2 }
      }
      },
      {
      position: 'top-left',
      label: '40',
      style: {
      font: { color: 'MidnightBlue', size: 30 },
      fill: { color: 'Aquamarine', opacity: 70 },
      stroke: { color: '#4B0082', width: 1 }
      }
      }
      ]);
    • Remove all overlays of a BPMN element.

      Notice that if you pass an id that is not related to an existing BPMN element, nothing happens on the rendering side.

      WARNING: could be renamed when adding support for removal of one or several specific overlays.

      Parameters

      • bpmnElementId: string

        The BPMN id of the element where to remove the overlays

      Returns void

      //  all overlays of the BPMN element with id: activity_1
      bpmnVisualization.bpmnElementsRegistry.removeAllOverlays('activity_1');