aTask = (Task)taskIter.next();
aTask = (Task) taskIter.next(); SupplyTaskKey key = getSupplyTaskKey(aTask); Task existingTask = getExistingTask(key); if (isPrediction(aTask)) { if (existingTask != null) { if (logger.isWarnEnabled()) { logger.warn("SupplyExpander rescinding redundant prediction: " + aTask); } else if (logger.isDebugEnabled()) { logger.debug("SupplyExpander rescinding unnecessary predicton: " + aTask); } inventoryPlugin.publishRemove(aTask); continue; } if (logger.isDebugEnabled()) { logger.debug("SupplyExpander adding prediction: " + aTask); } putExistingTask(key, aTask); } else { putExistingTask(key, aTask); if (existingTask != null && isPrediction(existingTask)) {  NewPlanElement pe = (NewPlanElement) existingTask.getPlanElement(); inventoryPlugin.publishRemove(existingTask); if (logger.isDebugEnabled()) { logger.debug("SupplyExpander replacing prediction with: " + aTask); } if (pe != null) { pe.resetTask(aTask);  Transaction.noteChangeReport(pe, new PlanElement.EstimatedResultChangeReport()); inventoryPlugin.publishChange(pe); continue; } } else { if (logger.isDebugEnabled()) { logger.debug("Adding supply task " + aTask); } } }
  public void expandAndDistributeRequisitions(Collection tasks) {	LogisticsInventoryPG logInvPG;	Task aTask, wdrawTask;	Iterator taskIter = tasks.iterator();	while (taskIter.hasNext()) {	    aTask = (Task)taskIter.next();	    wdrawTask = expandDemandTask(aTask, createWithdrawTask(aTask));	    logInvPG = getLogisticsInventoryPG(wdrawTask);	    if (logInvPG != null) {	      logInvPG.addWithdrawRequisition(wdrawTask);	    }	    ((NewWorkflow)wdrawTask.getWorkflow()).setAllocationResultAggregator(supplyARA);	}    }