<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:tahoma,new york,times,serif;font-size:10pt"><div style="font-family: tahoma,new york,times,serif; font-size: 10pt;">Dan,<br><br>Why would you have more than one Charge when you are not qualifying it? Are they all the same? Do you not care which one matches?<br><br>Earnie!<br><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Dan Seaver &lt;dan.seaver@ge.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> rules-users@lists.jboss.org<br><b><span style="font-weight: bold;">Sent:</span></b> Tuesday, November 4, 2008 12:50:09 PM<br><b><span style="font-weight: bold;">Subject:</span></b> [rules-users] Chart notation, update, and infinite loops<br></font><br>
<br>I'm trying to find a good technique for updating specific facts in working<br>memory. What I'm currently doing is something like this:<br><br>Rule "Update Amount"<br>&nbsp;  when<br>&nbsp; &nbsp; &nbsp; amountFact : Fact(name == "Amount")<br>&nbsp; &nbsp; &nbsp; charge : Charge()<br>&nbsp;  then<br>&nbsp; &nbsp; &nbsp; Double amount = amountFact.getAmount();<br>&nbsp; &nbsp; &nbsp; Double chargeAmount = charge.getAmount();<br>&nbsp; &nbsp; &nbsp; amountFact.setAmount(amount + chargeAmount);<br>&nbsp; &nbsp; &nbsp; update(amountFact);<br>end<br><br>The update statement causes an infinite loop.<br>I tried using no-loop, which works if there is 1 charge, but not if there<br>are more than one.<br><br>Any help with solutions or strategies would be much appreciated.<br>-- <br>View this message in context: <a href="http://www.nabble.com/Chart-notation%2C-update%2C-and-infinite-loops-tp20327483p20327483.html"
 target="_blank">http://www.nabble.com/Chart-notation%2C-update%2C-and-infinite-loops-tp20327483p20327483.html</a><br>Sent from the drools - user mailing list archive at <a target="_blank" href="http://Nabble.com">Nabble.com</a>.<br><br>_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" 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></div></div></div></body></html>