everything works fine. But if I try to create an extension field with something other than my:CustomNode, i.e. my:Test, modeler will throw an exception saying unknown type <my:Test>.
My question: is it possible to somehow define and allow any node be a valid extension element, even if it is not defined in my meta model?
You can use createAny for this purpose (cf. moddle/moddle.js at master · bpmn-io/moddle · GitHub). However, if create isn’t working for you, you should try and fix the issue. Where are you getting moddle from?
Sorry, multiple edits of me just being more confused, so I’ll post one concise one now:
using createAny, how can i specify that one of the fields should be the node text body instead of a property?
i.e. <thing>body</thing> instead of <thing text="body" /> ?
Tried all of these yet they all bind to a property:
createAny does not allow you to define a property as the body. As I said, you should try and fix your code so your model extension works. I’ve created a working example. Have a look at your code and try to figure out why it’s not working.