We have defined the rules by extending the CoRRuleBook as below and created the bean using SpringAwareRuleBookRunner. When executing the rule, results are set as null. Within the CoRRuleBook, results was set as expected but AbstractRuleBookRunner was not considering the results.
public class TestRuleBook extends CoRRuleBook<String> {
@Override
public void defineRules() {
addRule(
RuleBuilder.create()
.withFactType(ValidationRequest.class)
.withResultType(String.class)
.when(InsertIdRuleBook::isInvalid)
.then((facts, result) -> result.setValue("Invalid")))
.build());
}
}
@Configuration
public class ApplicationConfig {
@Bean
RuleBook testRuleBook() {
return new SpringAwareRuleBookRunner(
TestRuleBook.class, "package name");
}
}
Is SpringAwareRuleBookRunner only supports the POJO rules? Is there a way to execute the CoRRuleBook rules using runner class?
Hi,
We have defined the rules by extending the CoRRuleBook as below and created the bean using SpringAwareRuleBookRunner. When executing the rule, results are set as null. Within the CoRRuleBook, results was set as expected but AbstractRuleBookRunner was not considering the results.
Is SpringAwareRuleBookRunner only supports the POJO rules? Is there a way to execute the CoRRuleBook rules using runner class?