use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.
the class FlowAccumulateConstraint method buildPattern.
@Override
public void buildPattern() {
for (BaseDescr constraint : constraintDescrs) {
String expression = constraint.toString();
final DrlxParseResult drlxParseResult = new ConstraintParser(context, packageModel).drlxParse(null, null, expression, false);
drlxParseResult.accept(success -> {
success.setSkipThisAsParam(true);
new FlowExpressionBuilder(context).processExpression(success);
});
}
}
use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.
the class FlowDSLPattern method findAllConstraint.
public List<PatternConstraintParseResult> findAllConstraint(PatternDescr pattern, List<? extends BaseDescr> constraintDescrs, Class<?> patternType) {
final List<PatternConstraintParseResult> patternConstraintParseResults = new ArrayList<>();
for (BaseDescr constraint : constraintDescrs) {
final PatternConstraintParseResult patternConstraintParseResult = parseConstraint(pattern, patternType, constraint);
patternConstraintParseResults.add(patternConstraintParseResult);
}
return patternConstraintParseResults;
}
use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.
the class PatternDSL method findAllConstraint.
public List<PatternConstraintParseResult> findAllConstraint(PatternDescr pattern, List<? extends BaseDescr> constraintDescrs, Class<?> patternType) {
final List<PatternConstraintParseResult> patternConstraintParseResults = new ArrayList<>();
for (BaseDescr constraint : constraintDescrs) {
final PatternConstraintParseResult patternConstraintParseResult = parseConstraint(pattern, patternType, constraint);
patternConstraintParseResults.add(patternConstraintParseResult);
}
return patternConstraintParseResults;
}
use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.
the class RuleModelDRLPersistenceImpl method parseConstraint.
private void parseConstraint(final RuleModel m, final FactPattern factPattern, final ConditionalElementDescr constraint, final boolean isJavaDialect, final Map<String, String> boundParams, final PackageDataModelOracle dmo) {
for (BaseDescr descr : constraint.getDescrs()) {
if (descr instanceof ExprConstraintDescr) {
ExprConstraintDescr exprConstraint = (ExprConstraintDescr) descr;
Expr expr = parseExpr(exprConstraint.getExpression(), isJavaDialect, boundParams, dmo);
factPattern.addConstraint(expr.asFieldConstraint(m, factPattern));
}
}
}
use of org.drools.compiler.lang.descr.BaseDescr in project drools by kiegroup.
the class ExprConstraintDescrVisitor method visit.
private void visit(ConstraintConnectiveDescr descr) {
switch(descr.getConnective()) {
case AND:
solvers.startOperator(OperatorDescrType.AND);
for (BaseDescr baseDescr : descr.getDescrs()) {
visit(baseDescr);
}
solvers.endOperator();
break;
case OR:
solvers.startOperator(OperatorDescrType.OR);
for (BaseDescr baseDescr : descr.getDescrs()) {
visit(baseDescr);
}
solvers.endOperator();
break;
case XOR:
// TODO: Generated code -Rikkola-
break;
case INC_OR:
// TODO: Generated code -Rikkola-
break;
case INC_AND:
// TODO: Generated code -Rikkola-
break;
}
}
Aggregations