I have created custom extension classes (as explained in Access custom extension elements with the BPMN Model API), but am having trouble adding or setting children to them.
CustomMetadata metaElem = extensionElements.addExtensionElement(CustomMetadata.class);
PropertyId propId = modelInstance.newInstance(PropertyId.class);
propId.setTextContent(this.id);
metaElem.setPropertyId(propId);
When it gets to set or add child it throws an exception
New child is not a valid child element type: map; valid types are: