if (hasSub) { if (logger.isInfoEnabled()) logger.info(self + " removing task from workflow. Task: " + t); w.removeTask(t); } }
  private void removeTaskFromWorkflow(Task t) {    if (t == null)      return;    WorkflowImpl w = (WorkflowImpl)t.getWorkflow();    if (w == null)      return;    boolean hasSub = false;    synchronized (w) {      Enumeration enum = w.getTasks();      while (enum.hasMoreElements()) {	Task subT = (Task)enum.nextElement();	if (subT == t) {	  hasSub = true;	  break;	}      }    }