/** * Recursively fixes parent relationships, which are unset after deserialisation, such as when unparsed BPMN is read * from the database. If these parent relationships are not set, then the recursive namespace lookup fails. */ public void setElementParents() { if (elements == null) { return; } for (XmlElement child : elements) { if (child.parent == null) { child.parent = this; } child.setElementParents(); } } }
/** * Recursively fixes parent relationships, which are unset after deserialisation, such as when unparsed BPMN is read * from the database. If these parent relationships are not set, then the recursive namespace lookup fails. */ public void setElementParents() { if (elements == null) { return; } for (XmlElement child : elements) { if (child.parent == null) { child.parent = this; } child.setElementParents(); } } }
protected void startElementBpmn(String localpart, Object source, Integer index) { if (source==null) { startElementBpmn(localpart, index); } else if (source instanceof XmlElement) { XmlElement sourceElement = (XmlElement) source; sourceElement.setElementParents(); if (xml!=null) { xml.addElement(sourceElement, index); } sourceElement.setName(BPMN_URI, localpart); startElement(sourceElement); } else { throw new RuntimeException("Unknown BPMN source: "+source); } }