} else { externalAllocator.updateAllocationResult(refillAllocationSubscription); allocationAssessor.reconcileInventoryLevels(getTouchedInventories()); supplyExpander.updateAllocationResult(expansionSubscription);  PluginHelper.updateAllocationResult(MIExpansionSubscription); PluginHelper.updateAllocationResult(MITopExpansionSubscription); PluginHelper.updateAllocationResult(DetReqInvExpansionSubscription);
} else { externalAllocator.updateAllocationResult(refillAllocationSubscription); allocationAssessor.reconcileInventoryLevels(getTouchedInventories()); supplyExpander.updateAllocationResult(expansionSubscription);  PluginHelper.updateAllocationResult(MIExpansionSubscription); PluginHelper.updateAllocationResult(MITopExpansionSubscription); PluginHelper.updateAllocationResult(DetReqInvExpansionSubscription); }  takeInventorySnapshot(getTouchedInventories());   touchedInventories.clear(); touchedProjections = false;
  protected void execute() {    //clear our new refill list    newRefills.clear();    updateInventoryPolicy(inventoryPolicySubscription.getAddedCollection());    updateInventoryPolicy(inventoryPolicySubscription.getChangedCollection());    cycleStamp = (new Date()).getTime();    if (inventoryPolicy ==null) {      if (logger.isInfoEnabled ())	logger.info("\n InventoryPlugin " + supplyType + 		    " not ready to process tasks yet." +		    " my inv policy is: " + inventoryPolicy + " in " + getMyOrganization());      return;    }	    if (myOrganization == null) {      myOrganization = getMyOrganization(selfOrganizations.elements());    }    if (myOrganization == null) {      if (logger.isInfoEnabled())	logger.info("\n InventoryPlugin " + supplyType + 		    " not ready to process tasks yet." +		    " my org is: " + myOrganization);      return;    }    if (supplyTaskSubscription == null) {      myOrgName = myOrganization.getItemIdentificationPG().getItemIdentification();      inventoryFile = getInventoryFile(supplyType);      getInventoryData();      supplyExpander.initialize(myOrganization);      setupSubscriptions2();    }     if ((logOPlan == null) || logisticsOPlanSubscription.hasChanged()) {      Collection c = logisticsOPlanSubscription.getCollection();      for (Iterator i = c.iterator(); i.hasNext();) {	logOPlan = (LogisticsOPlan)i.next();	break;      }    }    if ((detReqHandler.getDetermineRequirementsTask(detReqSubscription, aggMILSubscription) != null) &&	(logOPlan != null)) {      boolean touchedRemovedProjections = 	supplyExpander.handleRemovedProjections(projectWithdrawTaskSubscription.getRemovedCollection());      supplyExpander.handleRemovedRequisitions(withdrawTaskSubscription.getRemovedCollection());      handleRemovedRefills(refillSubscription.getRemovedCollection());      Collection addedSupply = supplyTaskSubscription.getAddedCollection();      expandIncomingRequisitions(getTasksWithoutPEs(addedSupply)); // fix for bug #1695      Collection addedProjections = projectionTaskSubscription.getAddedCollection();      touchedProjections = expandIncomingProjections(getTasksWithoutPEs(addedProjections)); // fix for bug #1695      // call the Refill Generators if we have new demand      if (! getTouchedInventories().isEmpty()) {	  //check to see if we have new projections	  if (touchedProjections || touchedRemovedProjections) {	      refillProjGenerator.calculateRefillProjections(getTouchedInventories(), 							     criticalLevel, 							     getEndOfLevelSix(), 							     getEndOfLevelTwo(), 							     refillComparator);	  }	  refillGenerator.calculateRefills(getTouchedInventories(), inventoryPolicy,					   refillComparator);          externalAllocator.allocateRefillTasks(newRefills);      } else { // Backwards Flow	externalAllocator.updateAllocationResult(refillAllocationSubscription);        allocationAssessor.reconcileInventoryLevels(getTouchedInventories());	supplyExpander.updateAllocationResult(expansionSubscription);        // update the Maintain Inventory Expansion results        PluginHelper.updateAllocationResult(MIExpansionSubscription);        PluginHelper.updateAllocationResult(MITopExpansionSubscription);        PluginHelper.updateAllocationResult(DetReqInvExpansionSubscription);      }      takeInventorySnapshot(getTouchedInventories());      // touchedInventories should not be cleared until the end of transaction      touchedInventories.clear();      touchedProjections = false;      //testBG();    }  }