Pallete customization

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 !

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

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') ]
  }]
});

Thanks a lot Philip !!

Can we do similar for Context Menu ?

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

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.

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

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.