How are you executing the rules? Are you using web services via the Drools execution server? because, I have seen multiple firings in this scenario.<br><br clear="all">Regards,<br>Prem<br>
<br><br><div class="gmail_quote">2009/7/2 Shabbir Dhari <span dir="ltr"><<a href="mailto:sdhari@hotmail.com">sdhari@hotmail.com</a>></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>
Dear all<br><br>We are developing a financial business application that contains hundreds of business rules for validations and calculations. In the calculation rules we change the value of attribute if values past in the request is incorrect e.g. <br>
<br>rule "TaxCalc"<br> when<br> $i : Invoice()<br> Invoice (totalTax != (round(salesTax + (gstRate * salesAmount / 100) + importDuty – govtRebate, 2)))<br> then<br> i.setTotalTax(round(salesTax + (gstRate * salesAmount / 100) + importDuty – govtRebate, 2));<br>
end<br><br>The above code works perfectly fine. Only problem is the perform calculation twice. What I was looking if possible I can store calculated tax in a variable and simply assign variable to attribute if rule condiation fails. Some thing like:<br>
<br>rule "TaxCalc"<br> when<br> $i : Invoice() <br> Invoice (totalTax != calTax : (round(salesTax + (gstRate * salesAmount / 100)+ importDuty – govtRebate, 2)))<br> then<br> i.setTotalTax(calTax);<br>
end<br><br>But this does not work - shows system error at calculated value assignment. Is there any work around?<br><div class="hm"><br><br><hr>Click here to find out more <a href="http://windowslive.ninemsn.com.au/article.aspx?id=802246" target="_blank">POP access for Hotmail is here!</a></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>