use of org.drools.verifier.components.VerifierAccumulateDescr in project drools by kiegroup.
the class PatternDescrVisitor method visitAccumulateDescr.
private VerifierAccumulateDescr visitAccumulateDescr(AccumulateDescr descr) throws UnknownDescriptionException {
VerifierAccumulateDescr accumulate = new VerifierAccumulateDescr(pattern);
PatternDescrVisitor visitor = new PatternDescrVisitor(data, rule, solvers);
Pattern parentPattern = visitor.visitPatternDescr(descr.getInputPattern(), null, 0);
accumulate.setInitCode(descr.getInitCode());
accumulate.setActionCode(descr.getActionCode());
accumulate.setReverseCode(descr.getReverseCode());
accumulate.setResultCode(descr.getResultCode());
// XXX: Array seems to be always null.
// accumulate.setDeclarations(descr.getDeclarations());
accumulate.setClassName(descr.getClassName());
accumulate.setExternalFunction(descr.isExternalFunction());
accumulate.setFunctionIdentifier(descr.getFunctions().get(0).getFunction());
accumulate.setExpression(descr.getFunctions().get(0).getParams()[0]);
accumulate.setParentPath(parentPattern.getPath());
accumulate.setParentType(parentPattern.getVerifierComponentType());
data.add(accumulate);
return accumulate;
}
use of org.drools.verifier.components.VerifierAccumulateDescr 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));
}
Aggregations