Wolfgang Laun-2 wrote:
Try
(a) declaring parameters days and percentage as Integer
(b) keep the function as is, but remove dialect "mvel" from the rule.
Hi, thank you for your quick response.
I'm using Drools 5.0.1 in JBoss AS 4.2.3.
I've tested the two options with the following results:
b) Changing the dialect from mvel to java: Runs OK!
a) Change the parameters signature from int to Integer throws the following
exception:
org.drools.runtime.rule.ConsequenceException: [Error: unable to resolve
method:
kobo.regularSafaris.AddBookingPayment.addBookingPayment(kobo.regularSafaris.BookingRequest,
java.lang.Integer, java.lang.Integer) [arglength=3]]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:632)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:187)
at
com.rudder.packages.test.rules.PricesRulesTestCase.testNobelLowSeasonPrices(PricesRulesTestCase.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
Caused by: [Error: unable to resolve method:
kobo.regularSafaris.AddBookingPayment.addBookingPayment(kobo.regularSafaris.BookingRequest,
java.lang.Integer, java.lang.Integer) [arglength=3]]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:906)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:316)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:138)
at
org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:62)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:133)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:104)
at org.mvel2.MVEL.executeExpression(MVEL.java:978)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:87)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
... 22 more
--
View this message in context:
http://n3.nabble.com/Error-unable-to-resolve-method-tp108194p108294.html
Sent from the Drools - User mailing list archive at
Nabble.com.