private static void toConfig(DefComponent node, Element xml) { for ( Element element : MXml.getLocalElementIterator(xml)) { DefComponent nextNode = new DefComponent( element.getNodeName() ); NamedNodeMap attrList = element.getAttributes(); for (int i = 0; i < attrList.getLength(); i++) { Node attrXml = attrList.item(i); nextNode.addAttribute(attrXml.getNodeName(), element.getAttribute(attrXml.getNodeName())); } node.addDefinition(nextNode); toConfig(nextNode, element); } }
void doUpdate(Element xml) { id = xml.getAttribute("id"); name = xml.getAttribute("name"); incoming.clear(); for (Element eIn : MXml.getLocalElementIterator(xml, "bpmn2:incoming")) { String ref = MXml.getValue(eIn, false); if (ref.startsWith(XElement.SEQUENCE_FLOW)) { ref = ref.substring(XElement.SEQUENCE_FLOW.length()); ref = MString.beforeIndex(ref, '_'); } incoming.add(ref); } outgoing.clear(); for (Element eOut : MXml.getLocalElementIterator(xml, "bpmn2:outgoing")) { String ref = MXml.getValue(eOut, false); if (ref.startsWith(XElement.SEQUENCE_FLOW)) { ref = ref.substring(XElement.SEQUENCE_FLOW.length()); ref = MString.afterIndex(ref, '_'); } outgoing.add(ref); } }
public static void saveInto(XmlModel model, File file) throws Exception { if (!file.exists()) { createDocument(model, file); return; } Document doc = MXml.loadXml(file); Element eProcess = MXml.getElementByPath(doc.getDocumentElement(), "bpmn2:process"); for (Element child : MXml.getLocalElementIterator(eProcess)) eProcess.removeChild(child); model.createXml(eProcess); MXml.saveXml(doc.getDocumentElement(), file); }
for (Element child : MXml.getLocalElementIterator(elem)) { String eName = child.getNodeName(); if (eName.equals("bpmn2:outgoing")) {
for (Element elem : MXml.getLocalElementIterator(xml)) { String eName = elem.getNodeName(); if (eName.equals("bpmn2:laneSet")) { for (Element eLane : MXml.getLocalElementIterator(elem)) { if (eLane.getNodeName().equals("bpmn2:lane")) { XElement entry = new XLane(); entry.doUpdate(eLane); elements.put(eLane.getAttribute("id"), entry); for (Element eRef : MXml.getLocalElementIterator(eLane, "bpmn2:flowNodeRef")) { laneRefs.put(MXml.getValue(eRef, false), entry.getId()); for (Element elem : MXml.getLocalElementIterator(xml)) { String eName = elem.getNodeName(); if (eName.equals("bpmn2:boundaryEvent")) {
for (Element e : MXml.getLocalElementIterator(from, "attribute")) index.put(e.getAttribute("name"), e);