use of org.drools.compiler.lang.descr.MultiPatternDestinationDescr in project drools by kiegroup.
the class AndHandler method end.
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
final Element element = parser.endElementBuilder();
final AndDescr andDescr = (AndDescr) parser.getCurrent();
final Object parent = parser.getParent();
if (!andDescr.getDescrs().isEmpty()) {
if (parent instanceof RuleDescr || parent instanceof QueryDescr) {
final RuleDescr ruleDescr = (RuleDescr) parent;
ruleDescr.setLhs(andDescr);
} else if (parent instanceof MultiPatternDestinationDescr) {
final MultiPatternDestinationDescr mpDescr = (MultiPatternDestinationDescr) parent;
mpDescr.setInput(andDescr);
} else if (parent instanceof ConditionalElementDescr) {
final ConditionalElementDescr ceDescr = (ConditionalElementDescr) parent;
ceDescr.addDescr(andDescr);
}
}
return andDescr;
}
use of org.drools.compiler.lang.descr.MultiPatternDestinationDescr in project drools by kiegroup.
the class OrHandler method end.
public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
final Element element = parser.endElementBuilder();
final OrDescr orDescr = (OrDescr) parser.getCurrent();
final Object parent = parser.getParent();
if (!orDescr.getDescrs().isEmpty()) {
if (parent instanceof RuleDescr || parent instanceof QueryDescr) {
final RuleDescr ruleDescr = (RuleDescr) parent;
ruleDescr.getLhs().addDescr(orDescr);
} else if (parent instanceof MultiPatternDestinationDescr) {
final MultiPatternDestinationDescr mpDescr = (MultiPatternDestinationDescr) parent;
mpDescr.setInput(orDescr);
} else if (parent instanceof ConditionalElementDescr) {
final ConditionalElementDescr ceDescr = (ConditionalElementDescr) parent;
ceDescr.addDescr(orDescr);
}
}
return orDescr;
}
Aggregations