About custom palette element with predefined businessObject data

I.'m trying to customize palette but need that created element comes with some predefined data. I have a service task that so far I was able to set name and class. But dont know how to set an injected field. Meaning how to include the extensionElements with an entry of type field.
Right now I’m doing this:
function createSendNotificationTask(event) {
const shape = elementFactory.createShape({ type: ‘bpmn:ServiceTask’ });
shape.businessObject.name = ‘CustomName’;
shape.businessObject.class = ‘CustomClass’;
Now I dont know how to set properly the extensionElements with one Field.
Can anyone helpme with ideas?
Thank you very much.

1 Like

Thanks everyone. I think that I’ve found excellent guidance in bpmn-js-example-custom-elements.
Thank very much.

1 Like

I’m happy to hear that this example was helpful. :+1:

Hi @ipdlx0
Could you share your code implementation please?
I am also looking for an implementation on how to set ExtensionElements value. From the exemple on the github repo I can see how to get the extensionElements value, but not how to set it. I am new to bpmn