Expansion exp = (Expansion) task.getPlanElement();
  private void maybeAddDetermineRequirementsTasks(Task task) {    SortedSet stages =      (SortedSet) task      .getPrepositionalPhrase(FOR_OPLAN_STAGES)      .getIndirectObject();    if (stages.isEmpty()) {      if (logger.isDebugEnabled()) {        logger.debug("stages.isEmpty() not adding DR tasks");      }      return;    }    Expansion exp = (Expansion) task.getPlanElement();    Workflow wf = exp.getWorkflow();    // Check whether DR already exist    for (Enumeration subtasks = wf.getTasks(); subtasks.hasMoreElements(); ) {      NewTask subtask = (NewTask) subtasks.nextElement();      Verb verb = subtask.getVerb();      if (Constants.Verb.DetermineRequirements.equals(verb)) {        if (logger.isDebugEnabled()) {          logger.debug("Already have DetermineRequirements task " + subtask);        }	return;      }     }    if (logger.isDebugEnabled()) {      logger.debug("Adding DR tasks");    }    for (int i = 0; i < myParams.length; i++) {      NewTask subtask = createDetermineRequirementsTask(task, myParams[i]);      PluginHelper.wireExpansion(exp, subtask);      blackboard.publishAdd(subtask);      if (logger.isDebugEnabled()) {        logger.debug("Add DR task " + myParams[i]);      }    }  }