How can I update properties of an element?

Hi there,

I am trying to “force update” a DMN business task property through modeling API to create a new BPMN XML attribute on a DMN business task but after I fire the following code (without errors on the console):

bpmnModeler.get('modeling').updateProperties(selectedElement,{"camunda:decisionRef": value});`

bpmnModeler is the BpmnModeler.
selectedElement is the business element Shape.
value is the attribute value.

and try to save the BPMN model but in the XML the attribute is missing on the selected bpmn:BusinessRuleTask.
Can somebody help me what am I missing or how should I save property on a business task?

Thank you for your help in advance.

Hi,

Sorry, meantime I found the issue source.
The problem was that I pre loaded a BPMN XML file but in it the camunda namespace was missing. I added it and now everything is works as expected.

1 Like

Glad you could figure it out!