How to Customize the PaletteModule and ContextPadModule


#1

Hi
I am trying to customize the paletteModule and ContextPadModule I tried implementing by looking into
https://github.com/bpmn-io/bpmn-js/tree/master/lib/features/replace but I am not able to do so.

Could you please help me or provide me one example on how I can do it.
I tried going thorgh the code but nothing helped.


#2

Hi @yganatra

For customizing bpmn see this example custom bpmn


#3

Hi @Hadi_Jami

Thanks for your feedback.

I Implemented custom Paletter I wanted to allow user only some specific componenets You can see it here

Diagram

Now I want to Update the same in ContextPad Module here

ContextPad

and allow only some specific element any idea how to do it?


#4

Hi @yganatra

Your welcome, for contextpad see this sample [custom contextpad] or this sample [nyan]

Good luck!


Customize/disable specific dropdown items?
#5

Hi @Hadi_Jami

I tried doing that but by that you can not actually remove the elements of the contextPad you can only add extra.
Because of this code in getEntries

ContextPad.prototype.getEntries = function(element) {
  var entries = {};

  // loop through all providers and their entries.
  // group entries by id so that overriding an entry is possible
  forEach(this._providers, function(provider) {
    var e = provider.getContextPadEntries(element);

    forEach(e, function(entry, id) {
      entries[id] = entry;
    });
  });

  return entries;
};

Even if I delete the element because of default provider it’s getting added again