I was to add more than one element to my Palette, I can only add one. I created two CustomPalette.js files for each of the objects I want to add and imported them in my main.js, however, only the last imported element is shown in the palette
This is one of the CustomPalette.js files
export default class CustomPalette {
constructor(create, elementFactory, palette, translate) {
this.create = create;
this.elementFactory = elementFactory;
this.translate = translate;
palette.registerProvider(this);
}
getPaletteEntries(element) {
const { create, elementFactory, translate } = this;
function createServiceTask(event) {
const shape = elementFactory.createShape({
type: "vyoo_action:VyooAction",
});
create.start(event, shape);
}
return {
"create.service-task": {
group: "activity",
className: "bpmn-icon-service-task",
title: translate("Create Action"),
action: {
dragstart: createServiceTask,
click: createServiceTask,
},
},
};
}
}
CustomPalette.$inject = ["create", "elementFactory", "palette", "translate"];
The other one is the same, with different names and icons.
This is my index.js file in the custom folder.
import CustomPalette from "./CustomPalette";
export default {
__init__: ["customPalette"],
customPalette: ["type", CustomPalette],
};
An example is as follows if my main.js has the following when creating the modeller
additionalModules: [
BpmnPropertiesPanelModule,
BpmnPropertiesProviderModule,
customVyooActionModule,
customVyooFormModule,
],
Then customVyooFormModule is shown, but if it was
additionalModules: [
BpmnPropertiesPanelModule,
BpmnPropertiesProviderModule,
customVyooFormModule,
customVyooActionModule,
],
then customVyooFormModule is shown