if (alreadyFound) logger.warn(getAgentIdentifier() + " - more than one determine requirements task!"); Task t = (Task) enum.nextElement(); alreadyFound = true; if (t.getPlanElement() == null) {
if (alreadyFound) logger.warn(getAgentIdentifier() + " - more than one determine requirements task!"); Task t = (Task) enum.nextElement(); alreadyFound = true; if (t.getPlanElement() == null) { if (isInfoEnabled()) { logger.info(getAgentIdentifier() + " - redoTasks: Null Plan Element to be filled for task " +t.getUID()); } handleTask(t, subscriptionResults); } else { PlanElement prevPE = t.getPlanElement();   if (orgActivityInThePast (subscriptionResults)) {
  public void redoTasks() {    SubscriptionResults subscriptionResults = checkSubscriptions();    if (subscriptionResults != null) {      Enumeration enum = myInputTaskCallback.getSubscription().elements();      boolean alreadyFound = false;      while (enum.hasMoreElements()) {          if (alreadyFound)              logger.warn(getAgentIdentifier() + " - more than one determine requirements task!");          Task t = (Task) enum.nextElement();          alreadyFound = true;          if (t.getPlanElement() == null) {	    if (isInfoEnabled()) {              logger.info(getAgentIdentifier() + " - redoTasks: Null Plan Element to be filled for task " +t.getUID());	    }	    handleTask(t, subscriptionResults);          }          else {	    PlanElement prevPE = t.getPlanElement();	    // check to see if org activity in the past before we go tearing up the log plan	    if (orgActivityInThePast (subscriptionResults)) {	      if (isInfoEnabled()) {		logger.info(getAgentIdentifier() + " - redoTasks: not replanning " + t.getUID() + " because it's in the past.");	      }	    }	    else {	      if (isInfoEnabled()) {		logger.info(getAgentIdentifier() + " - redoTasks: Plan Element removed from " + t.getUID() + " and replanned.");	      }	      publishRemove(prevPE); // only remove old results if activity is in the future	      handleTask(t, subscriptionResults);	      // postcondition test	      if ((t.getPlanElement () == null) ||		  (t.getPlanElement () == prevPE)) {		logger.warn (getAgentIdentifier() + 			     " - redoTasks: didn't replan " + t.getUID () + 			     " properly, PE not updated.");	      }	    }          }      }    }