Hello,
I’ve been trying to create a custom BPMN script task with predefined scriptFormat and script.
I’m currently editing the custom elements example (https://github.com/bpmn-io/bpmn-js-example-custom-elements).
In CustomPalette.js I’ve been able to add the custom script task to the palette and add it to the canvas
'custom-scripttask': {
group: 'activity',
className: 'bpmn-icon-script-task',
title: translate('Script task'),
action: {
dragstart: createScriptTask('console.log("test");\nnext(null, "done");', 'Javascript'),
click: createScriptTask('console.log("test");\nnext(null, "done");', 'Javascript')
}
}
function createScriptTask(script, scriptFormat) {
return function(event) {
console.log(event);
const shape = elementFactory.createShape({
type: 'bpmn:ScriptTask'
});
create.start(event, shape);
};
}
but I’m not able to define scriptFormat and add the script tag as a child of the Script task.
How can I achieve this?