Trigger elementTemplate-chooser set function


#1

I set the value of elementTemplate through businessObject.set.

elementShape.businessObject.set(
  "camunda:modelerTemplate",
  this.selectedTaskId
);

It set the value in the UI also, the properties releated to the selected template is populating. But, the XML is not having the properties (extensionElements and camunda:inputOutput node). I’m getting as below.

 <serviceTask
  id="Task_0rciwng"
  camunda:modelerTemplate="com.camunda.example.MailTask" 
  camunda:class="com.mycompany.MailTaskImpl" />

But when the value is changed from UI (mouse select or change) the properties are binding. It triggers the set method from elementTemplate-chooser.

image

How to trigger the set function from selectBox or fire PropertiesPanel.prototype._bindListeners method explictely?


#2

Any advise or guidance would be greatly appreciated…!!


#3

Have you tried using the modeling API instead? There’s no need to set the property directly on the business object.

modeling.updateProperties(element, {
  'camunda:modelerTemplate': templateId
});