Open Tamir-Schwarz opened 5 years ago
There is a bug. Solved by extending GoldenRule and redefining default constructor:
public class ErrorOnFailureGoldenRule<T, U> extends GoldenRule<T, U> {
public ErrorOnFailureRule(Class<T> factType) {
super(factType, RuleChainActionType.ERROR_ON_FAILURE);
}
}
Then use it instead of GoldenRule class in the builder:
RuleBuilder.create(ErrorOnFailureGoldenRule.class)
.withFactType(Facts.class)
.withResultType(Result.class);
Hi, I am trying to set rule to throw exception on failure, i followed the documentation but it seems the rule still gets it default CONTINUE_ON_FAILURE.
I tried to debug it, on the when phase the GoldenRule is created again, but this time with the default RuleChainActionType (_CONTINUE_ONFAILURE) instead of my parameter. I think the issue is originated on class RuleBuilder line 246
Sample code:
As far as i understand, this test should pass, but it fails due to the fact that the error is not thrown and not stops the evaluation chain.
Did i missed something?
Thanks in advance, Tamir.