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;    }    // Check whether DR already exist    if (myDetermineRequirementsTasks.size() > 0) {      if (logger.isDebugEnabled()) {	logger.debug("Already have DetermineRequirements tasks " + 		     myDetermineRequirementsTasks);      }      return;    }    Expansion exp = (Expansion) task.getPlanElement();    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]);      }    }  }