Alright, so I'm looking into the DomainModelChangeListener that is registered on the Editor. It is called on every change, which is nice. But I noticed that the BPMN model of Activiti is not updated when the user uses the undo and redo logic. Is that supposed to be like that? 'Cause I think this affects all validators and marshallers that are getting the diagram and work on the flow elements.
Just tested if the export/save to xml is affected by it and it is. If you delete an element, return it via an undo and then save the diagram, that element is not included.
My workaround for that is that I disabled the undo and redo commands of Graphiti by overwriting the initializeActionRegistry method in the ActivitiDiagramEditor to do nothing. Copy, paste, delete via DEL and multiple selection still works with that.