How to set camunda:formKey on UserTask Object

I am trying to achieve Dynamic Form Binding for that i need the camunda:formKey on bussinessObject

Lets say i have to attached Each task with different Dynamic Form

If i set on initial.bpmn for the StartEvent_1 Object i can able to bind Form Dynamically But how i can set for UserTask Object since there xml is dynamic generating

I also have tried this https://github.com/bpmn-io/bpmn-js-examples/tree/master/bpmn-properties

But not update XML

so, what i want is

<bpmn:userTask id=ā€œTask_077xpifā€ name=ā€œApproveTaskā€ camunda:formKey=ā€œapproveTaskā€>
bpmn:incomingSequenceFlow_1g078nz</bpmn:incoming>
bpmn:outgoingSequenceFlow_109q686</bpmn:outgoing>
</bpmn:userTask>

Dynamically

Are you using the Camunda BPMN model extension? Otherwise this property will be unknown and not be serialized.

can you please send one example where we can attached above property on userTask Object

1 Like

@vikashsingh009 How did you attempt to set the property? What did you try? Where did you get stuck?

Here is my finding code

var BpmnJS = require(ā€˜bpmn-js/lib/Modelerā€™),
camundaExtensionModule = require(ā€˜camunda-bpmn-moddle/libā€™),
camundaModdle = require(ā€˜camunda-bpmn-moddle/resources/camunda.jsonā€™);

var BpmnModdle = require('bpmn-moddle');
 additionalModules: [
   PropertiesPanelModule,
   camundaExtensionModule 
   ],
   moddleExtension: {
    //custom: customModdle,
    camunda: camundaModdle
  }
   var moddle = new BpmnModdle({ camunda: camundaModdle });

if (isAny(element, [ā€˜bpmn:StartEventā€™])) {
var formKey = moddle.create(ā€˜camunda:formKeyā€™, {
$body: ā€˜approveTaskā€™
});
}

please help me on set camunda:formKey on startEvent Object