Pallete customization


#1

Hi team, i am seeing lot of posts on pallete customization, there is no easy way to do this. Can you please write an APIs which will return current pallete list and enable us to add new item. Thanks !


#2

Also , please add some APIs for Context Menu Customization. It would be really useful.


#3

It is in fact fairly easy to customize the palette. You can retrieve the current list of entries via myPalette.getEntries. In order to add entries to the palette simply register your provider. If you want to get rid of the default entries just override the default one by giving your provider the same name like so:

var modeler = new BpmnModeler({
  container: '#canvas',
  additionalModules: [{
    __init__: [ 'paletteProvider' ],
    paletteProvider: [ 'type', require('./MyProvider') ]
  }]
});

#4

Thanks a lot Philip !!

Can we do similar for Context Menu ?


#5

Do we have any documentation for this ? Can you please share link, if any.


#6

I assume BpmnModeler is the name under which you’ve required the modeler.

var BpmnModeler = require('bpmn-js/lib/Modeler');

// ...

var modeler = new BpmnModeler({
  // ...
});

You can see an example of the modeler here.

Sorry, if that was unclear.


#7

Can we make palette and canvas separate and have them in two different containers (div).


#8

You would have to customize the code for Palette then. Right now it uses the same container as the canvas and this is not configurable.