Home

Add a comment

 

Re: A really simple but powerful rule engine

A much required. Whilst trying the given examples, I found the following error Jan 13, 2015 3:43:12 PM ch.maxant.rules.Engine init INFO: *****Initialising rule engine...***** Jan 13, 2015 3:43:12 PM ch.maxant.rules.Engine init INFO: added rule: Rule [name=YouthTarif, expression=input.person.age < 26, outcome=YT2011, priority=3, namespace=ch.maxant.someapp.tarifs, description=null] Jan 13, 2015 3:43:12 PM ch.maxant.rules.Engine init INFO: added rule: Rule [name=SeniorTarif, expression=input.person.age > 59, outcome=ST2011, priority=3, namespace=ch.maxant.someapp.tarifs, description=null] Jan 13, 2015 3:43:12 PM ch.maxant.rules.Engine init INFO: added rule: Rule [name=DefaultTarif, expression=!(input.person.age < 26) && !(input.person.age > 59), outcome=DT2011, priority=3, namespace=ch.maxant.someapp.tarifs, description=null] Jan 13, 2015 3:43:12 PM ch.maxant.rules.Engine init INFO: added rule: Rule [name=LoyaltyTarif, expression=(!(input.person.age < 26) && !(input.person.age > 59)) && input.account.ageInMonths > 24, outcome=LT2011, priority=4, namespace=ch.maxant.someapp.tarifs, description=null] Jan 13, 2015 3:43:12 PM ch.maxant.rules.Engine init INFO: *****Engine initialisation completed in 141 ms***** Exception in thread "main" [Error: could not access field: rules.TarifRequest.person] [Near : {... input.person.age < 26 ....}] ^ [Line: 1, Column: 1] at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:552) at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:337) at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:140) at org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:68) at org.mvel2.ast.ASTNode.optimize(ASTNode.java:159) at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:115) at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:114) at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42) at org.mvel2.MVEL.executeExpression(MVEL.java:969) at ch.maxant.rules.Engine.getMatchingRules(Engine.java:364) at ch.maxant.rules.Engine.getBestOutcome(Engine.java:234) at ch.maxant.rules.Engine.getBestOutcome(Engine.java:221) at rules.Rules.main(Rules.java:38) Java Result: 1 using mvel2-2-.2.0.Final.jar rules-2.1.0.jar

Re: A really simple but powerful rule engine


Title
Body
HTML : b, strong, i, em, blockquote, br, p, pre, a href="", ul, ol, li, sub, sup
Name
E-mail address
Website
Remember me Yes  No 

E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later).