<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="3">
<div>&nbsp;</div>
<div><font size="2">This is in Drools 4.0.7</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font size="2">I have a class called SatManager with a field:</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font face="Courier New, monospace" size="2">ArrayList&lt;Satellite&gt; listOfOverheadSats </font></div>
<div><font face="Courier New, monospace" size="2">&nbsp;</font></div>
<div><font size="2">That has an appropriate getter method.</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font size="2">I have a relatively simple rule that goes something like this:</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font face="Courier New, monospace" size="2">when</font></div>
<div><font face="Courier New, monospace" size="2">&nbsp;&nbsp;&nbsp; $sat : Satellite(isOverhead == true)</font></div>
<div><font face="Courier New, monospace" size="2">&nbsp;&nbsp;&nbsp; $sm : SatManager($ls : listOfOverheadSats not contains $sat)</font></div>
<div><font face="Courier New, monospace" size="2">then</font></div>
<div><font face="Courier New, monospace" size="2">&nbsp;&nbsp;&nbsp; $ls.add($sat);</font></div>
<div><font face="Courier New, monospace" size="2">&nbsp;</font></div>
<div><font size="2">My problem is that Drools doesn't understand that the ArrayList has been modified, therefore this rule always fires on the same satellite if the sat object changes in any other way.</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font size="2">I've tried adding:</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font face="Courier New, monospace" size="2">update($sm);</font></div>
<div><font face="Courier New, monospace" size="2">&nbsp;</font></div>
<div><font size="2">To the consequence, but that only caused the rule to re-fire infinitely -- even with the no-loop keyword applied.</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font size="2">So my question is how does Drools manage its knowledge of changes to Collections embedded in fact objects? The documention for the 'contains/not contains' keyword did not explain this.</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font size="2">I'm really stumped here.</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font face="Tahoma, sans-serif" size="2" color="#008080">Allen F. Bagwell</font></div>
<div><font face="Tahoma, sans-serif" size="1" color="#008080">e-mail:&nbsp; afbagwe@sandia.gov</font></div>
<div><font face="Tahoma, sans-serif" size="1" color="#008080">phone:&nbsp; 505/284-4517</font></div>
<div><font face="Tahoma, sans-serif" size="1" color="#008080">fax:&nbsp; 505/ 844-7886</font></div>
<div><font face="Tahoma, sans-serif" size="1" color="#008080">&nbsp;</font></div>
<div style="margin-top: 5pt; margin-bottom: 5pt; "><font face="Tahoma, sans-serif" size="1" color="#008080">Ask your doctor if medical advice from a TV commercial is right for you.</font></div>
<div><font face="Tahoma, sans-serif" size="1">&nbsp;</font></div>
<div><font size="2">&nbsp;</font></div>
</font>
</body>
</html>