NewWorkflow wf = dp.expandedWorkflow;
Task drTask = getDetermineRequirementsTask(); if (drTask == null) {  return; } Expansion exp = (Expansion) drTask.getPlanElement(); if (exp == null) {  return; } NewWorkflow wf = (NewWorkflow) exp.getWorkflow();
  protected void watchRemovedTransportableAssets(Enumeration eAssets) {    if (!(eAssets.hasMoreElements())) {      // no assets      return;    }    if (logger.isInfoEnabled()) {      printInfo("Handle Asset removal");    }    // get workflow    DeployPlan dp = getDeployPlan();    if (dp == null) {      // no deploy plan      return;    }    NewWorkflow wf = dp.expandedWorkflow;    if (wf == null) {      // no workflow, so no tasks to worry about      return;    }    // remove tasks    Vector publishRemoveTasks = new Vector();    Vector workflowRemoveTasks = new Vector();    while (eAssets.hasMoreElements()) {      Asset assetForTrans = (Asset)eAssets.nextElement();      if (logger.isInfoEnabled()) {        printInfo("Look for removed asset: "+assetForTrans);      }      workflowRemoveTasks.clear();      Enumeration subTE = wf.getTasks();      while (subTE.hasMoreElements()) {        Task subT = (Task)subTE.nextElement();        // FIXME! what if asset group!        if (subT.getDirectObject() == assetForTrans) {          if (logger.isInfoEnabled()) {            printInfo("  Will remove Task: "+subT+                       " with DO: "+assetForTrans);          }          workflowRemoveTasks.add(subT);          publishRemoveTasks.add(subT);        }      }      for (int i = workflowRemoveTasks.size(); --i >= 0; ) {        Task removeWFT = (Task)workflowRemoveTasks.elementAt(i);        if (logger.isInfoEnabled()) {          printInfo("Remove from workflow Task: "+removeWFT);        }        wf.removeTask(removeWFT);      }    }    for (int i = publishRemoveTasks.size(); --i >= 0; ) {      Task removeT = (Task)publishRemoveTasks.elementAt(i);      if (logger.isInfoEnabled()) {        printInfo("publishRemove Task: "+removeT);      }      publishRemove(removeT);    }  }