logger.debug(inventoryPlugin.getSupplyType() + ": There are no predictions in the gap, no need to reconcile." + " Number of demand tasks: " + supplyTasks.size()); return;
logger.info(inventoryPlugin.getSupplyType() + ": There are no predictions in the gap, no need to reconcile." + " Number of demand tasks: " + supplyTasks.size()); if (! supplyTasks.isEmpty()) { for (Iterator iterator = supplyTasks.iterator(); iterator.hasNext();) { Task task = (Task) iterator.next(); if (logger.isErrorEnabled()) { logger.error(" No predictions in the gap, expanding tasks without reconciliation " + printTask(task)); } Task wdrawTask = expandDemandTask(task, createWithdrawTask(task)); LogisticsInventoryPG logInvPG = getLogisticsInventoryPG(wdrawTask); if (logInvPG != null) { logInvPG.addWithdrawRequisition(wdrawTask); } ((NewWorkflow) wdrawTask.getWorkflow()).setAllocationResultAggregator(supplyARA); if (logger.isInfoEnabled() && debugAgent()) logger.info(inventoryPlugin.getSupplyType() + " - Epanded task :" + printTask(task)); } } return;
  private void reconcile(String customerName, CustomerState state) {    UnaryPredicate tasksGapPred = new TasksInTheGap(customerName, state.getLatestEndTime(),                                                    state.getCustomerLeadTime());    UnaryPredicate predictionsGapPred = new PredictionsInTheGap(customerName, state.getLatestEndTime(),                                                                state.getCustomerLeadTime());    Collection supplyTasks = tasksInTheGap(tasksGapPred);    Collection predictionTasks = tasksInTheGap(predictionsGapPred);    if (predictionTasks.isEmpty()) {      logger.debug(inventoryPlugin.getSupplyType() + ": There are no predictions in the gap, no need to reconcile."                   + " Number of demand tasks: " +                   supplyTasks.size());      return;    }    // predicted items dictate what we need to reconcile    List sortedTasks = sortTasksByEndTime(supplyTasks);    List sortedPreds = sortTasksByEndTime(predictionTasks);    Collection uniquePredItems = pruneDuplicateItems(predictionTasks);    for (Iterator iterator = uniquePredItems.iterator(); iterator.hasNext();) {      String item = (String) iterator.next();      // pass in the complete lists, and then filter as needed for the item      reconcilePredictions(sortedTasks, sortedPreds, item);    }  }