<br>&nbsp;&nbsp; Take a look at the manual for details, but the short answer is:<br><br>mvn clean install<br>&nbsp;<br>&nbsp;&nbsp; You need maven and java installed.<br>&nbsp;&nbsp; To run that single unit test, you can simply import drools-core as a project into eclipse and just run the test.<br>
<br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2008/11/6 Marina <span dir="ltr">&lt;<a href="mailto:ppine7@yahoo.com">ppine7@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div>Thanks, Edson.<br>I do have the source code for Drools4.0.7. How do I build and run the unit tests?<br><br>Marina<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Edson Tirelli &lt;<a href="mailto:tirelli@post.com" target="_blank">tirelli@post.com</a>&gt;<br>
<b><span style="font-weight: bold;">To:</span></b> Rules Users List &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, November 6, 2008 10:46:46 AM<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] using BigDecimal in rules<br></font><div><div></div><div class="Wj3C7c"><br><br>&nbsp;&nbsp; It sounds like a bug. Can you get Drools
 source code and look at the unit test for this to make sure your scenario works there? The file is:<br><br>drools-core/src/test/java/org/drools/base/EvaluatorFactoryTest.java<br>
<br>&nbsp;&nbsp; Method is:<br><br>testBigDecimal()<br><br>&nbsp;&nbsp; Very easy to add your use case in there.<br><br>&nbsp;&nbsp; Let us know what you find.<br><br>&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2008/11/6 Marina <span dir="ltr">&lt;<a rel="nofollow" href="mailto:ppine7@yahoo.com" target="_blank">ppine7@yahoo.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div>
Hi,<br>
<br>I&#39;m getting unexpected results when when using BigDecimal objects for matching in rules. <br>I&#39;m generating DRL in my code, using freemaker.<br><br>I have a RuleEngineNumericFact object which has two attributes:<br>

String propertyName<br>BigDecimal propertyValue<br><br>Below is an example of a rule where I try to match a RuleEngineNumericFact object based on the two attributes:<br>
<br>rule &quot;aaa&quot;<br>&nbsp;&nbsp;&nbsp; agenda-group &quot;r1&quot;<br>&nbsp;&nbsp;&nbsp; dialect &quot;java&quot;<br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (RuleEngineNumericFact( propertyName == &quot;somename&quot; , <span style="font-weight: bold;">propertyValue == 10.8 </span>))<br>

&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String ruleId = drools.getRule().getName();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; firedRuleIDs.add(ruleId);<br>end<br><br><br>Then I create a new RuleEngineNumericFact object and set its propertyValue as following:<br><br>String <span style="font-weight: bold;">stringValue = &quot;10.8&quot;</span>;<br>


BigDecimal propertyValue = new BigDecimal(stringValue, new MathContext(10));<br><br>(I also tried to use default precision settings by creating the BigDecimal value as:<br>BigDecimal propertyValue = new BigDecimal(stringValue);<br>

)<br>
<br>When I insert this fact into the rule engine - the rule does not get fired, so the fact does not match.<br><br>One note: if the values are integeres (like, propertyValue == 100) - the rule gets fired. So, it is only the floating point numbers that do not match.<br>

<br>I generate the DRL in my Java code, using freemaker, and I specify the
value that will be used in the rule for matching by calling toString()
method on a BigDecimal object that I get from my business code. The toString() representation ends up to be the &quot;10.8&quot; value (for example).<br>According to the BigDecimal documentation, marshalling from/to the same string representation shoudl still produce BigDecimal objects that will return TRUE from the equals() method when compared.<br>

<br><br>any ideas why this is not working here?<br>How does Drools compare values of objects like BigDecimal?<br><br>thanks,<br><font color="#888888">Marina<br><br><br><br><br>
<br><br></font></div></div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a rel="nofollow" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a rel="nofollow" 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;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a rel="nofollow" href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>

</div></div></div></div></div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a 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;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>