protected void handleNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { super.handleNode(node, element, uri, localName, parser); String decisionRef = element.getAttribute("decisionRef"); if (decisionRef == null) { throw new IllegalArgumentException("Decision information is mandatory"); } RuleSetNode ruleSetNode = (RuleSetNode) node; ruleSetNode.setRuleFlowGroup(decisionRef); ruleSetNode.setLanguage(RuleSetNode.DRL_LANG); ruleSetNode.setNamespace((String) ruleSetNode.removeParameter(NAMESPACE_PROP)); ruleSetNode.setModel((String) ruleSetNode.removeParameter(MODEL_PROP)); ruleSetNode.setDecision((String) ruleSetNode.removeParameter(DECISION_PROP)); Map<String, String> inputs = new HashMap<>(); Map<String, String> outputs = new HashMap<>(); Map<String, String> inputTypes = new HashMap<>(); Map<String, String> outputTypes = new HashMap<>(); loadDataInputsAndOutputs(element, inputs, outputs, inputTypes, outputTypes, parser); ruleSetNode.setMetaData("DataInputs", inputTypes); ruleSetNode.setMetaData("DataOutputs", outputTypes); for (Entry<String, String> entry : inputs.entrySet()) { ruleSetNode.addInAssociation(new DataAssociation(entry.getValue(), entry.getKey(), Collections.emptyList(), null)); } for (Entry<String, String> entry : outputs.entrySet()) { ruleSetNode.addOutAssociation(new DataAssociation(entry.getKey(), entry.getValue(), Collections.emptyList(), null)); } }
ruleSetNode.setNamespace((String) ruleSetNode.removeParameter(NAMESPACE_PROP)); ruleSetNode.setModel((String) ruleSetNode.removeParameter(MODEL_PROP)); ruleSetNode.setDecision((String) ruleSetNode.removeParameter(DECISION_PROP));
ruleSetNode.setNamespace((String) ruleSetNode.removeParameter(NAMESPACE_PROP)); ruleSetNode.setModel((String) ruleSetNode.removeParameter(MODEL_PROP)); ruleSetNode.setDecision((String) ruleSetNode.removeParameter(DECISION_PROP));
protected void handleNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { super.handleNode(node, element, uri, localName, parser); String decisionRef = element.getAttribute("decisionRef"); if (decisionRef == null) { throw new IllegalArgumentException("Decision information is mandatory"); } RuleSetNode ruleSetNode = (RuleSetNode) node; ruleSetNode.setRuleFlowGroup(decisionRef); ruleSetNode.setLanguage(RuleSetNode.DRL_LANG); ruleSetNode.setNamespace((String) ruleSetNode.removeParameter(NAMESPACE_PROP)); ruleSetNode.setModel((String) ruleSetNode.removeParameter(MODEL_PROP)); ruleSetNode.setDecision((String) ruleSetNode.removeParameter(DECISION_PROP)); Map<String, String> inputs = new HashMap<>(); Map<String, String> outputs = new HashMap<>(); Map<String, String> inputTypes = new HashMap<>(); Map<String, String> outputTypes = new HashMap<>(); loadDataInputsAndOutputs(element, inputs, outputs, inputTypes, outputTypes, parser); ruleSetNode.setMetaData("DataInputs", inputTypes); ruleSetNode.setMetaData("DataOutputs", outputTypes); for (Entry<String, String> entry : inputs.entrySet()) { ruleSetNode.addInAssociation(new DataAssociation(entry.getValue(), entry.getKey(), Collections.emptyList(), null)); } for (Entry<String, String> entry : outputs.entrySet()) { ruleSetNode.addOutAssociation(new DataAssociation(entry.getKey(), entry.getValue(), Collections.emptyList(), null)); } }