Search in sources :

Example 11 with LiteralRestriction

use of org.drools.verifier.components.LiteralRestriction in project drools by kiegroup.

the class ExprConstraintDescrVisitor method createRestriction.

private void createRestriction(int currentOrderNumber, String value, Operator operator) {
    LiteralRestriction restriction = LiteralRestriction.createRestriction(pattern, value);
    restriction.setFieldPath(field.getPath());
    restriction.setPatternIsNot(pattern.isPatternNot());
    restriction.setParentPath(pattern.getPath());
    restriction.setParentType(pattern.getVerifierComponentType());
    restriction.setOrderNumber(currentOrderNumber);
    restriction.setOperator(operator);
    field.setFieldType(restriction.getValueType());
    data.add(restriction);
    solvers.addPatternComponent(restriction);
}
Also used : LiteralRestriction(org.drools.verifier.components.LiteralRestriction)

Aggregations

LiteralRestriction (org.drools.verifier.components.LiteralRestriction)11 Test (org.junit.Test)9 Set (java.util.Set)8 Pattern (org.drools.verifier.components.Pattern)8 RuleNameMatchesAgendaFilter (org.drools.core.base.RuleNameMatchesAgendaFilter)1 VerifierReport (org.drools.verifier.data.VerifierReport)1 Cause (org.drools.verifier.report.components.Cause)1 VerifierMessage (org.drools.verifier.report.components.VerifierMessage)1 VerifierMessageBase (org.drools.verifier.report.components.VerifierMessageBase)1 KieSession (org.kie.api.runtime.KieSession)1