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
How can MVELRuleFactory read rules from multiple files. Since we have a large ruleset we want to split them into multiple files so it can be managed easily.
I tried something like this
MVELRuleFactory mvelRuleFactory = new MVELRuleFactory(new JsonRuleDefinitionReader());
File dir = new File("./batch/src/main/resources/rules");
log.info(dir.getAbsolutePath());
File[] files = dir.listFiles((d, f) -> f.endsWith(".json"));
Rules rules = null;
for (File file : files) {
if (rules == null) {
rules = mvelRuleFactory.createRules(new FileReader(file));
} else {
Rules rules1 = mvelRuleFactory.createRules(new FileReader(file));
rules.register(rules1);
}
}
but this fails with the below error
Exception in thread "main" java.lang.IllegalArgumentException: Rule 'org.jeasy.rules.api.Rules' is not annotated with 'org.jeasy.rules.annotation.Rule'
at org.jeasy.rules.core.RuleDefinitionValidator.checkRuleClass(RuleDefinitionValidator.java:57)
at org.jeasy.rules.core.RuleDefinitionValidator.validateRuleDefinition(RuleDefinitionValidator.java:49)
at org.jeasy.rules.core.RuleProxy.asRule(RuleProxy.java:81)
at org.jeasy.rules.api.Rules.register(Rules.java:84)
It seems rules.register() can only accept Java Rules & not MVEL Rules. Is there a way to read rules from multiple files.
The text was updated successfully, but these errors were encountered:
Hi,
How can MVELRuleFactory read rules from multiple files. Since we have a large ruleset we want to split them into multiple files so it can be managed easily.
I tried something like this
but this fails with the below error
It seems
rules.register()
can only accept Java Rules & not MVEL Rules. Is there a way to read rules from multiple files.The text was updated successfully, but these errors were encountered: