Search in sources :

Example 1 with PatternOperatorDescr

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

the class PatternDescrVisitor method visitOrDescr.

@Override
protected void visitOrDescr(OrDescr descr) throws UnknownDescriptionException {
    PatternOperatorDescr operatorDescr = new PatternOperatorDescr(pattern, OperatorDescrType.OR);
    operatorDescr.setOrderNumber(orderNumber.next());
    data.add(operatorDescr);
    solvers.startOperator(OperatorDescrType.OR);
    visit(descr.getDescrs());
    solvers.endOperator();
}
Also used : PatternOperatorDescr(org.drools.verifier.components.PatternOperatorDescr)

Example 2 with PatternOperatorDescr

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

the class PatternDescrVisitor method visitAndDescr.

@Override
protected void visitAndDescr(AndDescr descr) throws UnknownDescriptionException {
    PatternOperatorDescr operatorDescr = new PatternOperatorDescr(pattern, OperatorDescrType.AND);
    operatorDescr.setOrderNumber(orderNumber.next());
    operatorDescr.setParentPath(getParent().getPath());
    operatorDescr.setParentType(getParent().getVerifierComponentType());
    data.add(operatorDescr);
    solvers.startOperator(OperatorDescrType.AND);
    visit(descr.getDescrs());
    solvers.endOperator();
}
Also used : PatternOperatorDescr(org.drools.verifier.components.PatternOperatorDescr)

Example 3 with PatternOperatorDescr

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

the class VerifierDataMapsTest method testSaveVerifierComponentAndGetForAllComponentTypes.

@Test
public void testSaveVerifierComponentAndGetForAllComponentTypes() {
    RulePackage rulePackage = VerifierComponentMockFactory.createPackage1();
    saveVerifierComponentAndGet(rulePackage);
    VerifierRule rule = VerifierComponentMockFactory.createRule1();
    saveVerifierComponentAndGet(rule);
    Pattern pattern = VerifierComponentMockFactory.createPattern1();
    saveVerifierComponentAndGet(pattern);
    saveVerifierComponentAndGet(new InlineEvalDescr(pattern));
    saveVerifierComponentAndGet(new ObjectType(new PackageDescr("testPackage1")));
    saveVerifierComponentAndGet(new RuleOperatorDescr(new AndDescr(), rule, OperatorDescrType.AND));
    saveVerifierComponentAndGet(new PatternOperatorDescr(pattern, OperatorDescrType.AND));
    saveVerifierComponentAndGet(new SubPattern(pattern, 0));
    saveVerifierComponentAndGet(new ReturnValueFieldDescr(pattern));
    saveVerifierComponentAndGet(new SubRule(rule, 0));
    saveVerifierComponentAndGet(new TextConsequence(rule));
    saveVerifierComponentAndGet(new PatternVariable(rule));
    saveVerifierComponentAndGet(new VerifierAccessorDescr(rule));
    saveVerifierComponentAndGet(new VerifierAccumulateDescr(pattern));
    saveVerifierComponentAndGet(new VerifierCollectDescr(pattern));
    saveVerifierComponentAndGet(new RuleEval(rule));
    saveVerifierComponentAndGet(new VerifierFieldAccessDescr(rule));
    saveVerifierComponentAndGet(new VerifierFromDescr(pattern));
    saveVerifierComponentAndGet(new VerifierMethodAccessDescr(rule));
    saveVerifierComponentAndGet(new PatternEval(pattern));
}
Also used : Pattern(org.drools.verifier.components.Pattern) SubPattern(org.drools.verifier.components.SubPattern) TextConsequence(org.drools.verifier.components.TextConsequence) PatternVariable(org.drools.verifier.components.PatternVariable) VerifierMethodAccessDescr(org.drools.verifier.components.VerifierMethodAccessDescr) ReturnValueFieldDescr(org.drools.verifier.components.ReturnValueFieldDescr) SubRule(org.drools.verifier.components.SubRule) VerifierFieldAccessDescr(org.drools.verifier.components.VerifierFieldAccessDescr) AndDescr(org.drools.drl.ast.descr.AndDescr) VerifierAccumulateDescr(org.drools.verifier.components.VerifierAccumulateDescr) VerifierRule(org.drools.verifier.components.VerifierRule) VerifierFromDescr(org.drools.verifier.components.VerifierFromDescr) SubPattern(org.drools.verifier.components.SubPattern) RuleEval(org.drools.verifier.components.RuleEval) RulePackage(org.drools.verifier.components.RulePackage) PatternEval(org.drools.verifier.components.PatternEval) ObjectType(org.drools.verifier.components.ObjectType) PatternOperatorDescr(org.drools.verifier.components.PatternOperatorDescr) RuleOperatorDescr(org.drools.verifier.components.RuleOperatorDescr) PackageDescr(org.drools.drl.ast.descr.PackageDescr) VerifierCollectDescr(org.drools.verifier.components.VerifierCollectDescr) VerifierAccessorDescr(org.drools.verifier.components.VerifierAccessorDescr) InlineEvalDescr(org.drools.verifier.components.InlineEvalDescr) Test(org.junit.Test)

Aggregations

PatternOperatorDescr (org.drools.verifier.components.PatternOperatorDescr)3 AndDescr (org.drools.drl.ast.descr.AndDescr)1 PackageDescr (org.drools.drl.ast.descr.PackageDescr)1 InlineEvalDescr (org.drools.verifier.components.InlineEvalDescr)1 ObjectType (org.drools.verifier.components.ObjectType)1 Pattern (org.drools.verifier.components.Pattern)1 PatternEval (org.drools.verifier.components.PatternEval)1 PatternVariable (org.drools.verifier.components.PatternVariable)1 ReturnValueFieldDescr (org.drools.verifier.components.ReturnValueFieldDescr)1 RuleEval (org.drools.verifier.components.RuleEval)1 RuleOperatorDescr (org.drools.verifier.components.RuleOperatorDescr)1 RulePackage (org.drools.verifier.components.RulePackage)1 SubPattern (org.drools.verifier.components.SubPattern)1 SubRule (org.drools.verifier.components.SubRule)1 TextConsequence (org.drools.verifier.components.TextConsequence)1 VerifierAccessorDescr (org.drools.verifier.components.VerifierAccessorDescr)1 VerifierAccumulateDescr (org.drools.verifier.components.VerifierAccumulateDescr)1 VerifierCollectDescr (org.drools.verifier.components.VerifierCollectDescr)1 VerifierFieldAccessDescr (org.drools.verifier.components.VerifierFieldAccessDescr)1 VerifierFromDescr (org.drools.verifier.components.VerifierFromDescr)1