Search in sources :

Example 1 with ConstraintType

use of org.drools.core.spi.Constraint.ConstraintType in project drools by kiegroup.

the class Pattern method setConstraintType.

private void setConstraintType(final MutableTypeConstraint constraint) {
    final Declaration[] declarations = constraint.getRequiredDeclarations();
    boolean isAlphaConstraint = true;
    for (int i = 0; isAlphaConstraint && i < declarations.length; i++) {
        if (!declarations[i].isGlobal() && declarations[i].getPattern() != this) {
            isAlphaConstraint = false;
        }
    }
    ConstraintType type = isAlphaConstraint ? ConstraintType.ALPHA : ConstraintType.BETA;
    constraint.setType(type);
}
Also used : ConstraintType(org.drools.core.spi.Constraint.ConstraintType) MvelConstraint(org.drools.core.rule.constraint.MvelConstraint) XpathConstraint(org.drools.core.rule.constraint.XpathConstraint) Constraint(org.drools.core.spi.Constraint)

Aggregations

MvelConstraint (org.drools.core.rule.constraint.MvelConstraint)1 XpathConstraint (org.drools.core.rule.constraint.XpathConstraint)1 Constraint (org.drools.core.spi.Constraint)1 ConstraintType (org.drools.core.spi.Constraint.ConstraintType)1