&nbsp;&nbsp; Ronald,<br><br>&nbsp;&nbsp; Yes, this is one way (I would say probably the preferred way) of doing it.<br>&nbsp;&nbsp; For BigDecimals, drools will use equals() method.<br><br>&nbsp;&nbsp; Look at the BigDecimalFactory class for details.<br><br>&nbsp;&nbsp; []s
<br>&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/7/9, Ronald R. DiFrango &lt;<a href="mailto:ron.difrango@gmail.com">ron.difrango@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;">
OK, I think I found it and here is what the rule could look like:<span class="q"><br><br>rule &quot;Repayment Code Requires Approval&quot;<br>&nbsp;&nbsp;&nbsp; salience 60<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; repaymentCode : RepaymentCode( code == &quot;MD&quot;, matchApprv == &quot;Y&quot; )
<br></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mdOutput : ModelDiscrepancyOutput( $amt1 : sumRTVQty, sumCmAndRnr == $amt1)<span class="q"><br>&nbsp;&nbsp;&nbsp; then <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(&quot;Repayment Code Requires Approval&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; processMDAdjustments(
drools.getWorkingMemory
().getQueryResults( &quot;MD Adjustments&quot; ), StatusConstants.APPROVAL);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(&quot;mdOutput: &quot; + mdOutput);<br>end<br><br></span>Now my question is, how does Drools handle these objects and the comparison because the underlying objects are BigDecimal?
<div><span class="e" id="q_113abd782bc6a9e8_5"><br><br><div><span class="gmail_quote">On 7/9/07, <b class="gmail_sendername">Ronald R. DiFrango</b> &lt;<a href="mailto:ron.difrango@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
ron.difrango@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
All,<br><br>I have the following rule:<br><br>rule &quot;Repayment Code Requires Approval&quot;<br>&nbsp;&nbsp;&nbsp; salience 60<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; repaymentCode : RepaymentCode( code == &quot;MD&quot;, matchApprv == &quot;Y&quot; )
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mdOutput : ModelDiscrepancyOutput( $amt1 : sumRTVQty, $amt2 : sumCmAndRnr)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; eval($amt1.doubleValue() == $amt2.doubleValue())<br>&nbsp;&nbsp;&nbsp; then <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(&quot;Repayment Code Requires Approval&quot;);
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; processMDAdjustments(drools.getWorkingMemory().getQueryResults( &quot;MD Adjustments&quot; ), StatusConstants.APPROVAL);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(&quot;mdOutput: &quot; + mdOutput);<br>end<br><br>If I remember correctly, there was going to be an update to the rules language that would allow me to eliminate the eval.&nbsp; Is this true and if so what is the syntax that accomplishes this?
<br><br><span name="st">Ron</span><br>
</blockquote></div><br>
</span></div><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;Software Engineer - JBoss Rules Core Developer<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>