Search in sources :

Example 6 with DrlExprParser

use of org.drools.drl.parser.DrlExprParser in project drools by kiegroup.

the class DescrDumper method processConstraint.

private void processConstraint(StringBuilder sbuilder, ExprConstraintDescr base, boolean isInsideRelCons, DumperContext context) {
    DrlExprParser expr = new DrlExprParser(context.getRuleContext().getConfiguration().getLanguageLevel());
    ConstraintConnectiveDescr result = expr.parse(base.getExpression());
    if (result.getDescrs().size() == 1) {
        dump(sbuilder, result.getDescrs().get(0), 0, isInsideRelCons, context);
    } else {
        dump(sbuilder, result, 0, isInsideRelCons, context);
    }
}
Also used : ConstraintConnectiveDescr(org.drools.drl.ast.descr.ConstraintConnectiveDescr) DrlExprParser(org.drools.drl.parser.DrlExprParser)

Example 7 with DrlExprParser

use of org.drools.drl.parser.DrlExprParser in project drools by kiegroup.

the class ExprConstraintDescrVisitor method visit.

public void visit(ExprConstraintDescr descr) {
    DrlExprParser drlExprParser = new DrlExprParser(LanguageLevelOption.DRL5);
    ConstraintConnectiveDescr constraintConnectiveDescr = drlExprParser.parse(descr.getExpression());
    visit(constraintConnectiveDescr.getDescrs());
}
Also used : ConstraintConnectiveDescr(org.drools.drl.ast.descr.ConstraintConnectiveDescr) DrlExprParser(org.drools.drl.parser.DrlExprParser)

Aggregations

DrlExprParser (org.drools.drl.parser.DrlExprParser)7 ConstraintConnectiveDescr (org.drools.drl.ast.descr.ConstraintConnectiveDescr)6 DroolsParserException (org.drools.drl.parser.DroolsParserException)3 DescrBuildError (org.drools.compiler.compiler.DescrBuildError)2 EvaluatorRegistry (org.drools.compiler.builder.impl.EvaluatorRegistry)1 Declaration (org.drools.core.rule.Declaration)1 QueryArgument (org.drools.core.rule.QueryArgument)1