Updating Extension Elements: Best Practice?


I’m aware that I can use modeling.updateProperties() on base element attributes. I note that the modeling API suggests that this function is for “simple properties”.

What is the best practice for updating extension elements? I have created custom extension elements but I have not been successful updating their values. Do I simply have to step through the businessObject.extensionElements.values array, and then:

  • if the element exists: find the element by name ($type) and then update the element object
  • if the element does not exist, push a new object onto the values array?

Is this the best approach or does modeling.updateProperties() work for extension elements?


The approach you’ve described is pretty much how it’s done in the bpmn-js-properties-panel. :slight_smile: