if (logger.isDebugEnabled() && debugAgent()) logger.debug(inventoryPlugin.getSupplyType() + " - Comms up on restore task " + printTask(aTask));
if (logger.isInfoEnabled() && debugAgent()) logger.info(inventoryPlugin.getSupplyType() + " - Comms up on restore task " + printTask(aTask));
  public void expandAndDistributeRequisitions(Collection tasks) {    LogisticsInventoryPG logInvPG;    Task aTask, wdrawTask;    Iterator taskIter = tasks.iterator();    while (taskIter.hasNext()) {      aTask = (Task) taskIter.next();      if (logger.isDebugEnabled() && debugAgent())        logger.debug(inventoryPlugin.getSupplyType() + " - Received task " + aTask.getUID());      if (commStatusExists(getCustomerName(aTask))) {  // if any status objects exist        if (customerCommsUp(getCustomerName(aTask))) {          if (logger.isDebugEnabled() && debugAgent())            logger.debug(inventoryPlugin.getSupplyType() + " - Comms up on restore task " + printTask(aTask));          // CUSTOMER COMM IS UP          if (isPrediction(aTask)) {            // we ignore committed predictions and rescind uncommitted ones            // We may change this because we would have to execute out 25            // days during comm loss in order for the tasks to become committed.            // removeUncommittedPredictions(aTask);            //TODO:  do something with these.            continue;          }        } else {          // CUSTOMER COMM IS DOWN          CustomerState cs = (CustomerState) customerStates.get(getCustomerName(aTask));          if (isPrediction(aTask)) {            if (logger.isDebugEnabled() && debugAgent()) {              logger.debug(inventoryPlugin.getSupplyType() + " -Comm is down " +                           printTheGap(aTask) + " task " + printTask(aTask));            }            if (beforeTheGap(aTask, cs.getLatestEndTime())) {              inventoryPlugin.publishRemove(aTask);              if (logger.isDebugEnabled() && debugAgent()) {                logger.debug(inventoryPlugin.getSupplyType() + " -Comm is down, removing prediction: " +                             printTheGap(aTask) + " task " + printTask(aTask));              }              //removeUncommittedPredictions(aTask);  // otherwise we ignore the task              continue;            }            if (afterTheGap(cs.getLatestEndTime(), cs.customerLeadTime, aTask)) {              inventoryPlugin.publishRemove(aTask);  // don't need to check commitment should be beyond              if (logger.isDebugEnabled() && debugAgent()) {                logger.debug(inventoryPlugin.getSupplyType() + " - Comm is down, removing prediction after the gap "                             + printTheGap(aTask) + " task : " + printTask(aTask));              }              continue;            }          } else {  // ignore demand tasks in or after the gap while we are waiting for the alarm to expire            if (inTheGap(cs.getLatestEndTime(), cs.customerLeadTime, aTask)                || afterTheGap(cs.getLatestEndTime(), cs.customerLeadTime, aTask) || isCommitted(aTask)) {              if (logger.isDebugEnabled() && debugAgent()) {                logger.debug(inventoryPlugin.getSupplyType() +                             " -Comm is down, ignoring demand task committed || in || after the gap "                             + printTheGap(aTask) + " task: " + printTask(aTask));              }              continue;            }          }        }      }      Date commitDate = aTask.getCommitmentDate();      if (commitDate != null) {        wdrawTask = expandDemandTask(aTask, createWithdrawTask(aTask));        logInvPG = getLogisticsInventoryPG(wdrawTask);        if (logInvPG != null) {          logInvPG.addWithdrawRequisition(wdrawTask);        }        ((NewWorkflow) wdrawTask.getWorkflow()).setAllocationResultAggregator(supplyARA);        if (logger.isDebugEnabled() && debugAgent())          logger.debug(inventoryPlugin.getSupplyType() + " - Epanded task :" + printTask(aTask));      } else {        if (isPrediction(aTask)) {          logger.error(" Prediction ");        }        logger.error(" task has null commit date: " + commitDate);        continue;      }    }  }