How to reset a component programatically


I’m using the Element Template, and I need to reset all the properties defined to a certain component (UserTask, etc) because I don’t want to keep all the previous modifications I made after I choose a new template.

How to do so, programmatically in a correct way ?

Thank you!

Why would you like to do this? You can always undo all changes.

For example, the Camunda Modeler does not remove the changes made in the properties before selecting an element template, so I need to avoid this.

Is It possible to undo ALL the changes at the same time, or only the last change and sequentially the previous?

Currently you cannot hard reset (as I would call it) an element to its initial state.

If you have some specific requirements, please be more precise, i.e. by providing BPMN 2.0 XML and/or links to source code that help clarifying your point.

If the hard reset removes only the previous configured properties, the content in the extensionElements etc, then It solves the problem.