<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
The Added collection will only ever have an object _once_.<br>
<br>
In particular:<br>
When someone calls publishAdd (foo)<br>
then anyone with a matching subscription will see 'foo' on their Added
Collection the next time that they execute -- and only then. After
that, it is no longer on the added collection.<br>
<br>
The Changed collected will contain an object any time the object was
changed -- but again, only once per change.<br>
<br>
So<br>
plugin a calls publishChange(foo)<br>
<br>
plugin B is woken up and the execute() method runs<br>
If plugin B looks, it will see 'foo' on the Changed Collection.<br>
<br>
when plugin B finishes its execute, the Changed list is cleared out.<br>
<br>
<br>
So --- make sure that you are looking each time.<br>
<br>
Also, you could try looking at the /tasks servlet or the History
servlet to look for your objects to make sure that they are there and
changing when you expect them to.<br>
Or you could try looking at the subscription itself, not just the
added/changed lists, to see what objects are in your collection -- if
you dont care whether it just was added or changed, then just do
hypothesisSub.iterator()<br>
<br>
Aaron Helsinger<br>
BBN<br>
<br>
James Livingood wrote:
<blockquote cite="mid5E39C4594D28CB4B854E6C61FC43690A1561FF@ED.TFMT.IAC"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <div><font color="#000000" face="Arial" size="2">Hello all,</font></div>
  <div> </div>
  <div><font face="Arial" size="2">
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">I’ve subscribed to the
object I want:</span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"></span></font><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">HypothesisSub =
(IncrementalSubscription)
getBlackboardService().subscribe(HYPOTHESIS_PRED);</span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"></span></font> </p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">And in my execute() I
have:</span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">for (Iterator i =
HypothesisSub.getAddedCollection().iterator(); i.hasNext();) {</span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"></span></font>// <font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">grabs all the information
and puts it into MS SQL. </span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">}</span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"></span></font><font
 face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span><font
 class="Apple-style-span" face="Arial" size="4"><span
 class="Apple-style-span" style="font-size: 13px;">for (Iterator i =
HypothesisSub.getChangedCollection().iterator(); i.hasNext();) {</span></font></span></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span><font
 class="Apple-style-span" face="Arial" size="4"><span
 class="Apple-style-span" style="font-size: 13px;">// grab all the data
AGAIN and put it into MS SQL</span></font></span></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span><font
 class="Apple-style-span" face="Arial" size="4"><span
 class="Apple-style-span" style="font-size: 13px;">}</span></font></span></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span><font
 class="Apple-style-span" face="Arial" size="4"><span
 class="Apple-style-span" style="font-size: 13px;"></span></font></span></span></font> </p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span><font
 class="Apple-style-span" face="Arial" size="4"><span
 class="Apple-style-span" style="font-size: 13px;">Why does the
getAddedCollection run when the plugin is first started up, but the
getChangedCollection does not run when objects that I've subscribed to
change/new ones are added/etc?</span></font></span></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span><font
 class="Apple-style-span" face="Arial" size="4"><span
 class="Apple-style-span" style="font-size: 13px;"></span></font></span></span></font> </p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span><font
 class="Apple-style-span" face="Arial" size="4"><span
 class="Apple-style-span" style="font-size: 13px;"></span></font></span></span></font> </p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span><font
 class="Apple-style-span" face="Arial" size="4"><span
 class="Apple-style-span" style="font-size: 13px;">Thanks for any
hints, information, things to check, etc.</span></font></span></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><span><font
 class="Apple-style-span" face="Arial" size="4"><span
 class="Apple-style-span" style="font-size: 13px;">James</span></font></span></span></font></p>
  </font></div>
  <pre wrap=""><hr size="4" width="90%">
_______________________________________________
Cougaar-developers mailing list
<a class="moz-txt-link-abbreviated"
 href="mailto:Cougaar-developers@cougaar.org">Cougaar-developers@cougaar.org</a>
<a class="moz-txt-link-freetext"
 href="http://cougaar.org/mailman/listinfo/cougaar-developers">http://cougaar.org/mailman/listinfo/cougaar-developers</a>
  </pre>
</blockquote>
</body>
</html>