Adding scripts automatically in upload of a process to modeler

Hello,
I want to add scripts to all Human task when i upload a process to modeler,
Can you help me with this problem?

script listener

thanks in advance

Hi,

in principle you can follow along with the solution that @philippfromme already posted: Fill automatically input .

…when I upload a proecss to modeler

I assume you mean “open” right? You would then need to intercept the shape.create command. Also note that for UserTasks you would need a bpmn:TaskListener. See example in this sandbox

hello,
I mean when i open a process to the bpmn canvas.
I’m intercepting shape.create at preExecute but it dont run when i run ImportXML function.
For the task listener i know how to do it, thnks, but i have problem with the interception.

It’s true that the shape.create command does not get executed during import. You’ll better use the bpmnElement.added event for this

eventBus.on('bpmnElement.added', function (context) {
  console.log('element got imported: ', context.element);
});

Feel free to use this Sandbox to try it out.