Yep. Post the code for setSelected(). I'm guessing it takes an Integer or
int and you're passing it a String.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Cabou, Carl
Sent: Thursday, May 08, 2008 9:23 AM
To: rules-users(a)lists.jboss.org
Subject: [rules-users] Newbie question / NoSuchMethodError error
Greetings,
I'm new to Drools and I've written a decision table based rule using excel.
The rule validates ok and I've deployed my package fine.
I've written a piece of code to test my rules, I want to set the
calculatedRate to 125 when I get selected field equal to "0 - 50" :
...
StatelessSession statelessSession = rb.newStatelessSession(); Data data=new
Data(); data.setSelected("0 - 50"); statelessSession.execute(data); // set
private Integer field ...
When I run the code I get a exeption :
java.lang.NoSuchMethodError: java.lang.Integer.valueOf(I)Ljava/lang/Integer;
I don't understand why Drools tries to convert to Integer something which is
already Integer !!!!
-----------
Here is the rules code.
rule "setCalculateRate_11"
salience 65525
when
Data(selected == "0 - 50")
then
object.setCalculatedRate(125);
end
--------------
The CalculatedRate field is a java.lang.Integer object.
Does anybody has an idea ??
Regards,
Carl.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users