Custom CamundaPropertiesProvider


#1

i am trying to override CamundaPropertiesProvider.i have created my own class RtCamundaPropertiesProvider that extends CamundaPropertiesProvider when i load getTabs method it is hitting CamundaPropertiesProvider 's getTabs() method instead of overriden method.
And my code is like below

export class RtCamundaPropertiesProvider extends CamundaPropertiesProvider {
    static $inject = ['eventBus', 'bpmnFactory', 'elementRegistry', 'elementTemplates', 'translate'];
    constructor(eventBus: IEventBus, bpmnFactory: any, elementRegistry: any, elementTemplates: any, translate: any) {
        super(eventBus, bpmnFactory, elementRegistry, elementTemplates, translate);
    }
    getTabs(element:any) {
        let baseGetTabs: any = super.getTabs(element);
        console.log(baseGetTabs);
        return baseGetTabs;
    }
}

And registering of my class is like below

        {
          __init__: ['camundaPropertiesProvider'],
          camundaPropertiesProvider: ['type', RtCamundaPropertiesProvider]
        },

Any help would be much appreciated!


#2

How does you bootstrapping look like? Make sure to override the Camunda properties provider by using the same module name or to not include it in the first place.


#3

i have changed that bootstrapping but still CamundaPropertiesProvider’s getTabs() method is calling.
modified code is like below.

        {
          __init__: ['propertiesProvider'],
          propertiesProvider: ['type', RtCamundaPropertiesProvider]
        },

#4

This is because you explicitly call it yourself:


#5

Hi nikku!
Thanks for your reply,
Tried by removing super.getTabs(element). still facing same issue


#6

@nikku, Have a quick question. Is my CamundaPropertiesProvider import is correct?

import CamundaPropertiesProvider from 'bpmn-js-properties-panel/lib/provider/camunda/CamundaPropertiesProvider';


#7

I figured it out, i was extending RTCamundaPropertiesProvider with CamundaPropertiesProvider.Actually it should extend with PropertiesActivator. working code is

import PropertiesActivator from 'bpmn-js-properties-panel/lib/PropertiesActivator'
import { IEventBus } from '../interface';
export class RTCamundaPropertiesProvider extends PropertiesActivator {
    static $inject = ['eventBus', 'bpmnFactory', 'elementRegistry', 'elementTemplates', 'translate'];
    constructor(eventBus: IEventBus, bpmnFactory: any, elementRegistry: any, elementTemplates: any, translate: any) {
        super(eventBus);
    }
    getTabs(element) {...}
}