use of org.drools.compiler.lang.descr.PatternSourceDescr in project drools by kiegroup.
the class ModelGeneratorVisitor method visit.
@Override
public void visit(PatternDescr descr) {
final PatternSourceDescr patternSource = descr.getSource();
if (patternSource != null && patternSource instanceof CollectDescr) {
fromCollectVisitor.trasformFromCollectToCollectList(descr, (CollectDescr) patternSource);
} else {
if (patternSource instanceof AccumulateDescr) {
AccumulateDescr accSource = (AccumulateDescr) patternSource;
if (accSource.getFunctions().isEmpty() || accSource.getFunctions().get(0).getBind() == null) {
patternVisitor.visit(descr).buildPattern();
accumulateVisitor.visit(accSource, descr);
} else {
accumulateVisitor.visit(accSource, descr);
patternVisitor.visit(descr).buildPattern();
}
} else {
patternVisitor.visit(descr).buildPattern();
}
}
}
Aggregations