DeployPlan newDP = new DeployPlan(selfOrg, selfOrgAct, adjustDurationDays, overrideFromLocation,  prepoStartDate);
DeployPlan oldDeployPlan = getDeployPlan(); if ((oldDeployPlan != null) && (oldDeployPlan.expandedWorkflow != null)) { killWorkflow(oldDeployPlan.expandedWorkflow); oldDeployPlan.expandedWorkflow = null; }  replaceDeployPlan(selfOrgAct);    watchDueDetermineRequirementsTasks();
  protected void watchAddedSelfOrgDeployAct(OrgActivity selfOrgAct) {    // We don't know how long this task will take, so we    // use the default task adjustment duration!    int adjustDurationDays = defaultAdjustDurationDays;    Date prepoStartDate = null;    if (offsetDays > 0) {      // If OffsetDays was specified as an input parameter, use Oplan C Day + offset as       // start date for the Task      Collection oplanCol = query(new OplanByUIDPred(selfOrgAct.getOplanUID()));      // Should be exactly one oplan for an OrgActivity      Oplan oplan = (Oplan) oplanCol.iterator().next();      prepoStartDate = new Date(oplan.getCday().getTime() + (MILLIS_PER_DAY * offsetDays));    }    DeployPlan newDP =       new DeployPlan(selfOrg, selfOrgAct, adjustDurationDays, overrideFromLocation,  prepoStartDate);    if (DEBUG) {      printDebug(newDP.toString());    }    if (!newDP.isValid()) {      if (newDP.fromLoc == null)        printError("This Organization lacks a MilitaryPG HomeLocation!");      printError("The DeployPlan lacks needed information and is ignored!");    } else {      DeployPlan oldDP = getDeployPlan();      if (oldDP != null) {        if (DEBUG) {          printDebug("Replace Deployment Plan!\n"+                     "OLD:\n"+oldDP+"\n"+                     "NEW:\n"+newDP);        }                // Kill Associated Expansion        if (oldDP.expandedWorkflow != null) {          killWorkflow(oldDP.expandedWorkflow);        }      }      setDeployPlan(newDP);      // Re-process all existing DETERMINEREQUIREMENTS tasks in      // light of the new Org Activity      Collection drTasks = drTasksSub.getCollection();      for (Iterator iterator = drTasks.iterator();           iterator.hasNext();) {        Task drTask = (Task) iterator.next();        reprocessDetermineRequirementsTask(drTask);      }    }  }