publishAdd(workflow);
  public void createExpansion(Iterator tasksForWorkflow, Task parentTask) {    // this needs to publish the Expansion, all the subtasks and    // the workflow    if (parentTask.getPlan() == null) {      throw (new RuntimeException("Unable to find plan for expansion - parentTask is " + parentTask.getUID()));    }    NewWorkflow workflow = getFactory().newWorkflow();    workflow.setIsPropagatingToSubtasks(true); // was true, but may lead to dangling unprocessed internal Supply tasks    workflow.setParentTask(parentTask);    workflow.setAllocationResultAggregator(AllocationResultAggregator.DEFAULT);    while (tasksForWorkflow.hasNext()) {      NewTask subTask = (NewTask) tasksForWorkflow.next();      subTask.setWorkflow(workflow);      workflow.addTask(subTask);      publishAdd(subTask);    }    publishAdd(workflow);    Expansion expan = getFactory().createExpansion(parentTask.getPlan(),                                                   parentTask, workflow,                                                   null);    publishAdd(expan);    return;  }