Search in sources :

Example 1 with PatternSourceDescr

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();
        }
    }
}
Also used : CollectDescr(org.drools.compiler.lang.descr.CollectDescr) PatternSourceDescr(org.drools.compiler.lang.descr.PatternSourceDescr) AccumulateDescr(org.drools.compiler.lang.descr.AccumulateDescr)

Aggregations

AccumulateDescr (org.drools.compiler.lang.descr.AccumulateDescr)1 CollectDescr (org.drools.compiler.lang.descr.CollectDescr)1 PatternSourceDescr (org.drools.compiler.lang.descr.PatternSourceDescr)1