@SuppressWarnings("unchecked") protected void readMultiInstanceLoopCharacteristics( org.w3c.dom.Node xmlNode, ForEachNode forEachNode, ExtensibleXmlParser parser) { // sourceRef org.w3c.dom.Node subNode = xmlNode.getFirstChild(); while (subNode != null) { String nodeName = subNode.getNodeName(); if ("inputDataItem".equals(nodeName)) { String variableName = ((Element) subNode).getAttribute("id"); String itemSubjectRef = ((Element) subNode).getAttribute("itemSubjectRef"); DataType dataType = null; Map<String, ItemDefinition> itemDefinitions = (Map<String, ItemDefinition>) ((ProcessBuildData) parser.getData()).getMetaData("ItemDefinitions"); if (itemDefinitions != null) { ItemDefinition itemDefinition = itemDefinitions.get(itemSubjectRef); if (itemDefinition != null) { dataType = new ObjectDataType(itemDefinition.getStructureRef()); } } if (dataType == null) { dataType = new ObjectDataType("java.lang.Object"); } if (variableName != null && variableName.trim().length() > 0) { forEachNode.setVariable(variableName, dataType); } } else if ("outputDataItem".equals(nodeName)) { String variableName = ((Element) subNode).getAttribute("id"); String itemSubjectRef = ((Element) subNode).getAttribute("itemSubjectRef"); DataType dataType = null; Map<String, ItemDefinition> itemDefinitions = (Map<String, ItemDefinition>) ((ProcessBuildData) parser.getData()).getMetaData("ItemDefinitions"); if (itemDefinitions != null) { ItemDefinition itemDefinition = itemDefinitions.get(itemSubjectRef); if (itemDefinition != null) { dataType = new ObjectDataType(itemDefinition.getStructureRef()); } } if (dataType == null) { dataType = new ObjectDataType("java.lang.Object"); } if (variableName != null && variableName.trim().length() > 0) { forEachNode.setOutputVariable(variableName, dataType); } } else if ("loopDataOutputRef".equals(nodeName)) { String outputDataRef = ((Element) subNode).getTextContent(); String outputDataName = dataOutputs.get(outputDataRef); if (outputDataName != null && outputDataName.trim().length() > 0) { forEachNode.setOutputCollectionExpression(outputDataName); } } subNode = subNode.getNextSibling(); } }
@Override public Object start( final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException { ItemDefinition item = (ItemDefinition) super.start(uri, localName, attrs, parser); String id = item.getId(); String structureRef = item.getStructureRef(); String itemDefinitionId = module.getRepoHelper().getGlobalItemDefinitions().get(id); if (itemDefinitionId == null) { module.getRepoHelper().getGlobalItemDefinitions().put(id, structureRef); } return item; }