&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Looks like a bug to me. May I ask you plz to open a JIRA?<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2008/1/25, José Arrarte &lt;<a href="mailto:jarrarte@gmail.com">jarrarte@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>First of all, I&#39;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).<br><br>I&#39;ve been having some problems when comparing BigDecimals (using the compareTo method). I didn&#39;t find this issue in any previous post or in Drools&#39; JIRA. However, I&#39;ve been using Drools for a short time, so I hope you people can help me.
<br><br>The problem:<br><br>Firing this (simple) rule:
<br>
<br><span style="font-family: courier new,monospace;">
rule &quot;Test Rule&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; when
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; &nbsp; &nbsp; $dec : java.math.BigDecimal() from java.math.BigDecimal.TEN;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eval( $dec.compareTo(java.math.BigDecimal.ONE) &gt; 0 )
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; then 
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; &nbsp; &nbsp; System.out.println(&quot;OK!&quot;);                
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end
</span><br style="font-family: courier new,monospace;">
<br>Fires this exception:
<br>
<br><span style="font-family: courier new,monospace;">
org.drools.RuntimeDroolsException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:76)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:145)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple(SingleTupleSinkAdapter.java:20)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.reteoo.FromNode.assertTuple(FromNode.java:90)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(SingleTupleSinkAdapter.java:55)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.reteoo.Rete.assertObject(Rete.java:175)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:179)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1315)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:462)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at com.sample.DroolsTest.main(DroolsTest.java:33)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at com.sample.Rule_Test_Rule_0Eval0Invoker.evaluate(Rule_Test_Rule_0Eval0Invoker.java:12)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:72)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        ... 14 more<br><br><font face="arial,sans-serif">I&#39;ve reported the issue in JIRA (<a href="http://jira.jboss.com/jira/browse/JBRULES-1433" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://jira.jboss.com/jira/browse/JBRULES-1433</a>)<br>
<br>Best regards,<br>
José<br></font></span>
<br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;JBoss Drools Core Development<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>