if (mySub.getRemovedList().hasMoreElements ()) { Enumeration removedtasks = mySub.getRemovedList(); while (removedtasks.hasMoreElements()) { Task t = (Task) removedtasks.nextElement(); if (xxdebug) System.out.println ("UTILWorkflowTaskCallback : Telling listener that task " + t.getUID() + " was removed."); ((UTILGenericListener) myListener).handleRemovedTask(t); } }
  public void reactToChangedFilter () {    Enumeration newTasks = mySub.getAddedList();    UTILGenericListener genericListener =       (UTILGenericListener) myListener;    boolean anythingChanged = newTasks.hasMoreElements();    int i = 0;        Map seenTasksMap = new HashMap ();    while (newTasks.hasMoreElements()) {      Task newT = (Task)newTasks.nextElement();      if ((seenTasksMap.get (newT) == null) &&	  isWellFormed (newT)) {	seenTasksMap.put (newT, newT);	genericListener.handleTask(newT);	i++;      }    }    Enumeration changedTasks = mySub.getChangedList();    if (!anythingChanged)      anythingChanged = changedTasks.hasMoreElements();        while (changedTasks.hasMoreElements()) {      Task changedT = (Task)changedTasks.nextElement();      if ((seenTasksMap.get (changedT) == null) &&	  isWellFormed (changedT)) {	seenTasksMap.put (changedT, changedT);	genericListener.handleTask(changedT);	i++;      }    }    if (anythingChanged)      synchronized (myListener) {	if (xxdebug)	  System.out.println ("UTILWorkflowCallback : Notifying " + myListener + 			      " about " + i + 			      " tasks");	myListener.notify ();      }    if (xxdebug) {      Enumeration removedTasks = mySub.getRemovedList();      if (removedTasks.hasMoreElements ()) {	Task wfTask = (Task) removedTasks.nextElement ();	String unit = "Undefined"; //(UTILPrepPhrase.hasPrepNamed(wfTask, Constants.Preposition.FOR)) ? 	// ("" + UTILPrepPhrase.getPrepNamed(wfTask, Constants.Preposition.FOR)) : "nonUnit";	System.err.println(myListener.getClass() + " saw removed allocatable task " + 			   wfTask.getUID () + " from "  + unit);      }    }  }