Hello again. I was out of office, sorry for not answering sooner...
I've opened a JIRA issue, #1433, with a test case and a full stack trace
desciption:
http://jira.jboss.com/jira/browse/JBRULES-1433
Best regards,
José Arrarte
On Jan 30, 2008 9:55 AM, Edson Tirelli <tirelli(a)post.com> wrote:
Looks like a bug to me. May I ask you plz to open a JIRA?
[]s
Edson
2008/1/25, José Arrarte <jarrarte(a)gmail.com>:
>
> Hello,
>
> First of all, I'd like to thank all the people involved in making this
> tool such a great one (this includes whoever writes the reference manual as
> well).
>
> I've been having some problems when comparing BigDecimals (using the
> compareTo method). I didn't find this issue in any previous post or in
> Drools' JIRA. However, I've been using Drools for a short time, so I hope
> you people can help me.
>
> The problem:
>
> Firing this (simple) rule:
>
> rule "Test Rule"
> when
> $dec : java.math.BigDecimal() from java.math.BigDecimal.TEN;
> eval( $dec.compareTo(java.math.BigDecimal.ONE) > 0 )
> then
> System.out.println("OK!");
> end
>
> Fires this exception:
>
> org.drools.RuntimeDroolsException: java.lang.ClassCastException:
> java.lang.Integer cannot be cast to java.math.BigDecimal
> at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:76)
> at org.drools.reteoo.EvalConditionNode.assertTuple(
> EvalConditionNode.java:145)
> at org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple(
> SingleTupleSinkAdapter.java:20)
> at org.drools.reteoo.FromNode.assertTuple(FromNode.java:90)
> at
> org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(
> SingleTupleSinkAdapter.java:55)
> at org.drools.reteoo.LeftInputAdapterNode.assertObject(
> LeftInputAdapterNode.java:116)
> at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(
> SingleObjectSinkAdapter.java:22)
> at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
>
> at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
>
> at
> org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute
> (ReteooWorkingMemory.java:179)
> at org.drools.common.AbstractWorkingMemory.executeQueuedActions(
> AbstractWorkingMemory.java:1315)
> at org.drools.common.AbstractWorkingMemory.fireAllRules(
> AbstractWorkingMemory.java:462)
> at org.drools.common.AbstractWorkingMemory.fireAllRules(
> AbstractWorkingMemory.java:433)
> at com.sample.DroolsTest.main(DroolsTest.java:33)
> Caused by: java.lang.ClassCastException: java.lang.Integer cannot be
> cast to java.math.BigDecimal
> at
com.sample.Rule_Test_Rule_0Eval0Invoker.evaluate(Rule_Test_Rule_0Eval0Invoker.java:12)
>
> at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:72)
> ... 14 more
>
> I've reported the issue in JIRA (
>
http://jira.jboss.com/jira/browse/JBRULES-1433)
>
> Best regards,
> José
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @
www.jboss.com
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users