You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the above statement, the rules inside of MyRuleBook do not get the Auditor value injected. So when I try to run the rules set I get an NPE in AuditableRule#invoke (Line 100) because it tries to update the RuleStatus but has no Auditor instance to update.
If I try to build a RuleBook using the RuleBookBuilder and use the addRule chained approach as described in the documentation, it works. Is this Auditor not available when we try to create a rulebook using a specific RuleBook class?
The text was updated successfully, but these errors were encountered:
Looking a bit deeper, I believe this is due to the fact that my class rulebook is extending CoRRuleBook, so when the rules are lazily added to the rulebook it is executing the CoRRuleBook#addRule instead of RuleBookAuditor#addRule. However my custom Rulebook does get decorated with RuleBookAuditor like I expect.
Suppose I have a class
And I want to reference that class in the RuleBookBuilder process:
RuleBookBuilder.create(MyRuleBook.class).asAuditor().build();
When I use the above statement, the rules inside of
MyRuleBook
do not get the Auditor value injected. So when I try to run the rules set I get an NPE in AuditableRule#invoke (Line 100) because it tries to update the RuleStatus but has no Auditor instance to update.If I try to build a RuleBook using the RuleBookBuilder and use the
addRule
chained approach as described in the documentation, it works. Is this Auditor not available when we try to create a rulebook using a specific RuleBook class?The text was updated successfully, but these errors were encountered: