Thanks Alex, appreciate the direct recommendation.
Some context on our use case that might change the advice:
Our concern with the DRL path is owning the JSON → DRL generation layer (escaping, type handling, debugging generated strings) and KieBuilder.buildAll() being all-or-nothing if one generated DRL is malformed.
With SyntheticRuleUnitBuilder, we skip DRL entirely and each JSON rule becomes a Java predicate, bad rules fail individually, and all matches are collected in one pass. We'd handle conflict resolution in Java (~15 lines) instead of agenda-groups.
Given these constraints, would you still recommend agenda-groups which needs legacy drools Implementation? Or is there a way to use agenda-groups programmatically without DRL generation?
[edit]
Thanks Alex, appreciate the direct recommendation.
Some context on our use case that might change the advice:
1.Rules are defined at runtime by ops teams via a web UI and stored as JSON in a database. No DRL files on disk — we'd have to generate DRL strings from JSON on every cache refresh.
2.Java 21 with virtual threads.
3.We need all matched rules per request for telemetry, not just the one that fires.[optional, but good to have]
Our concern with the DRL path is owning the JSON → DRL generation layer (escaping, type handling, debugging generated strings) and KieBuilder.buildAll() being all-or-nothing if one generated DRL is malformed.
With SyntheticRuleUnitBuilder, we skip DRL entirely and each JSON rule becomes a Java predicate, bad rules fail individually, and all matches are collected in one pass. We'd handle conflict resolution in Java (~15 lines) instead of agenda-groups.
Given these constraints, would you still recommend agenda-groups which needs legacy drools Implementation? Or is there a way to use agenda-groups programmatically without DRL generation?
To view this discussion visit https://groups.google.com/d/msgid/drools-usage/CA%2BNJsVjzXy36%2BNhJjucV4-NdaNgh1-emzz02BzngibMNeszdTQ%40mail.gmail.com.
Thanks for the clarification and for filing the documentation issue.
In my service service where rules are defined at runtime on UI and stored in a database. At cache refresh, we convert each rule to a Java predicate and register it with SyntheticRuleUnitBuilder using .filter() for LHS conditions and .execute() to collect matches.
A quick question on LHS and RHS Compatibility:: is there any performance difference between a single compound .filter() predicate (all conditions ANDed) versus multiple chained .filter() calls, in terms of PHREAK node optimization?