if (logger.isDebugEnabled() && debugAgent()) { if (isPrediction(aTask)) { logger.debug(" Received prediction task  " + aTask); } }
if (logger.isDebugEnabled() && debugAgent()) logger.debug(inventoryPlugin.getSupplyType() + " - Received task " + aTask.getUID());
  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()) {        if (isPrediction(aTask)) {          logger.debug(" Received prediction task  " + aTask);        }      }      if (commStatusExists(getCustomerName(aTask))) {  // if any status objects exist        if (customerCommsUp(getCustomerName(aTask))) {          // CUSTOMER COMM IS UP          if (isPrediction(aTask)) {            // we ignore committed predictions and rescind uncommitted ones            removeUncommittedPredictions(aTask);            continue;          }        } else {          // CUSTOMER COMM IS DOWN          CustomerState cs = (CustomerState) customerStates.get(getCustomerName(aTask));          if (isPrediction(aTask)) {            if (beforeTheGap(aTask, cs.getLatestEndTime())) {              removeUncommittedPredictions(aTask);  // otherwise we ignore the task              continue;            }            if (afterTheGap(cs.customerLeadTime, aTask)) {              inventoryPlugin.publishRemove(aTask);  // don't need to check commitment should be beyond              if (logger.isDebugEnabled() && debugAgent()) {                logger.debug("Comm is down, removing prediction after the gap " + printTheGap(aTask));              }              continue;            }          } else {  // ignore demand tasks in or after the gap            if (inTheGap(cs.getLatestEndTime(), cs.customerLeadTime, aTask)                || afterTheGap(cs.customerLeadTime, aTask)) {              if (logger.isDebugEnabled() && debugAgent()) {                logger.debug("Comm is down, ignoring demand task in/after the gap " + printTheGap(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("Epanding task " + aTask);      } else {        if (isPrediction(aTask)) {          logger.error(" Prediction ");        }        logger.error(" task has null commit date: " + commitDate);        continue;      }    }  }