Thanks for the hint. We've done that now and despite the ModelInstance being not much less cumbersome than usual XML Parsers, the code works in principle. However, we've run into some new issues which might or might not be directly related to that
1) We've deployed the initial version of the process with a WAR file and than updated the ModelInstance by code, generating a new version of the deployment. However, if we shutdown and restart the process engine, the WAR file is parsed again and the first version of the process is added as a new version, so that the changes in between are hidden in version 2, whereas the current version 3 is identical to version 1. Deleting the WAR file in the file system solves the problem, but is not really an option for production. Is that the expected behavior? Can we change it somehow?
2) We have three different processes each in it's own deployment. Somehow we managed to make changes to two of them, so that they don't show up in cockpit anymore and also are not found, if we look for all process defintions with flag latestVersionOnly equals true. If we set latestVersionOnly to false, all definitions are found, including the two "lost". Is that a bug, or did we alter anything that is expected to cause this behavior? We played around with extension elements and the category
3) We've started with the "shortcut" version of adding our extension element as described here
http://docs.camunda.org/7.3/guides/user-guide/#bpmn-model-api-extension-elementswhich is working well. However, we found it a bit tedious to retrieve the element afterwards by iterating through the collection of extension elements and comparing the key. We thought that it might be more elegant to write an own class similar to the CamundaFormData example in the documentation. So we derived from
BpmnModelElementInstance, but ran into an exception
org.camunda.bpm.model.xml.ModelException: Cannot create instance of ModelType interface de.hofuniversity.iisys.camunda.bpmn.model.NuxeoAssociations: no such type registered
We have no idea where or how to register, or what we did wrong.
Thanks in advance for any new hints.