About custom palette element with predefined businessObject data

Hi,
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.

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: