} else { logger.warn("OrgActivities received but no LogOPlan object. "+getOrgName()+" waiting..."); return;
  protected void execute() {    if ((supplyClassPG == null) ||        (oplanSubscription.isEmpty()) ||        (orgActivities.isEmpty())) {      processedDetReq = false;      return;    }    genProjTaskScheduler.initForExecuteCycle();    if (!detReqSubscription.isEmpty()) {      Iterator detReqIt = detReqSubscription.iterator();      Task detReqTask = (Task) detReqIt.next();      processedDetReq = (!(detReqTask.getPlanElement() == null));      //There should be both a determineRequirements task      //and an oplan before kicking off the expander for the first time.      //from then on out we should be catching additional assets added, or removed.      //It is also possible that this agent has no assets and the expander has to dispose of the detReqTask.      //if there is a new determine requirements task or new oplan do this      if (((!orgActivities.getAddedCollection().isEmpty()) &&          (!processedDetReq)) ||          (!detReqSubscription.getAddedCollection().isEmpty())) {        processDetReq(detReqSubscription,                      assetsWithPGSubscription);      }      //otherwise just issue a new      else if (!assetsWithPGSubscription.getAddedCollection().isEmpty()) {        processDetReq(detReqSubscription,                      assetsWithPGSubscription.getAddedCollection());      } else if (!assetsWithPGSubscription.getRemovedCollection().isEmpty()) {        removeFromDetReq(detReqSubscription,                         assetsWithPGSubscription.getRemovedCollection());      }    }    if (myOrganization == null) {      myOrganization = getMyOrganization(selfOrganizations.elements());      if (myOrganization != null) {        projectSupplySubscription = (IncrementalSubscription)            blackboard.subscribe(new ProjectSupplyPredicate(supplyType, getOrgName(), taskUtils));      }    }    if (myOrganization == null) {      if (logger.isInfoEnabled()) {        logger.info("\n DemandForecastPlugin " + supplyType +                    " not ready to process tasks yet." +                    " my org is: " + myOrganization);      }      return;    }    // get the Logistics OPlan (our homegrown version with specific dates).    if ((logOPlan == null) || logisticsOPlanSubscription.hasChanged()) {      Iterator opIt = logisticsOPlanSubscription.iterator();      if (opIt.hasNext()) {        //we only expect to have one        logOPlan = (LogisticsOPlan) opIt.next();      }      //Only after we have all the constituent parts to start going - oplan, orgActitivities, logOplan do we      //lay down      if (logOPlan != null) {        if ((supplyClassPG != null) &&            (genProjTaskScheduler == null)) {          setupTaskScheduler();//          genProjSubscription = (IncrementalSubscription) blackboard.subscribe(new GenProjPredicate(supplyType, taskUtils));        }      }    }//    if (genProjSubscription != null) {    HashSet justExpandedPGs = new HashSet();    if (! genProjTaskScheduler.isEmpty()) {      Collection removed = genProjTaskScheduler.getRemovedCollection();      Collection added = genProjTaskScheduler.getAddedCollection();      TimeSpan timeSpan = genProjTaskScheduler.getCurrentTimeSpan();      if (! removed.isEmpty())        processRemovedGenProjs (removed, timeSpan);      if (! added.isEmpty())        justExpandedPGs = processNewGenProjs (added, timeSpan);      genProjTaskScheduler.finishedExecuteCycle();    }    //if the determine requirements task has already fired we're this far down    //in the execute we should check the hash table subscriptions and see if    //we have to regenerate some of the expansions due to subscription changes.    if (processedDetReq) {      checkAndProcessHashSubscriptions(justExpandedPGs);    }    //Update the Allocation results on new or changed GP PlanElements    if (genProjPESubscription.hasChanged()) {      if (!genProjPESubscription.getAddedCollection().isEmpty()) {        generateProjectionsExpander.updateAllocationResults(genProjPESubscription.getAddedCollection());      }      if (!genProjPESubscription.getChangedCollection().isEmpty()) {        generateProjectionsExpander.updateAllocationResults(genProjPESubscription.getChangedCollection());      }    }    //Update the Allocation results on new or changed DR PlanElements    if (detReqPESubscription.hasChanged()) {      if (!detReqPESubscription.getAddedCollection().isEmpty()) {        determineRequirementsExpander.updateAllocationResults(detReqPESubscription.getAddedCollection());      }      if (!detReqPESubscription.getChangedCollection().isEmpty()) {        determineRequirementsExpander.updateAllocationResults(detReqPESubscription.getChangedCollection());      }    }    //deal with rehydration    if (rehydrate) {      rehydrateHashMaps();      rehydrate = false;    }  }