subtask.setVerb( new Verb( Grammar.SOURCE));
subtask.setVerb( Verb.get( Grammar.SOURCE));
  protected synchronized void expanderRollup( Expansion expansion) {    Task task = expansion.getTask();    String verbStr = task.getVerb().toString();    if ( verbStr.equals( Grammar.SOURCE)) {      Workflow workflow = expansion.getWorkflow();      if ( workflow != null) {        AllocationResult reportedResult = expansion.getReportedResult();        if ( reportedResult != null) {          AllocationResult estimatedResult = expansion.getEstimatedResult();          if ( estimatedResult == null || !Utility.equalResults( estimatedResult, reportedResult)) {            double prefQuantity = task.getPreferredValue( AspectType.QUANTITY);            double reportedQuantity = reportedResult.getValue( AspectType.QUANTITY);            double shortfallCount = prefQuantity - reportedQuantity;            if ( shortfallCount == 0) {              // At the point where shortfallCount is 0,              // make sure there are no unnecessary subtasks at the end of the workflow.              boolean workflowChanged = false;              boolean deletedFromEndOfWorkflow = true;              while ( deletedFromEndOfWorkflow) {                deletedFromEndOfWorkflow = false;                Task lastSubtask = Utility.getLastSubtaskInWorkflow( workflow);                Allocation allocation = (Allocation)lastSubtask.getPlanElement();                AllocationResult lastSubtaskResult = allocation.getReportedResult();                if ( lastSubtaskResult.getValue( AspectType.QUANTITY) == 0) {                  workflowChanged = true;                  deletedFromEndOfWorkflow = true;                  ((NewWorkflow)workflow).removeTask( lastSubtask);                  publishRemove( lastSubtask);                }              }              if ( workflowChanged) {                publishChange( workflow);              }              // Create Estimated Results. Setup default values first.              double estimatedCost = 0.0;              double estimatedQuantity = reportedQuantity;              double estimatedStart = task.getPreferredValue( AspectType.START_TIME);              double estimatedEnd = task.getPreferredValue( AspectType.END_TIME);              // Override default values with those in Reported Result if exist there.              if ( reportedResult.isDefined( AspectType.COST)) {                estimatedCost = reportedResult.getValue( AspectType.COST);              }              if ( reportedResult.isDefined( AspectType.START_TIME)) {                estimatedStart = reportedResult.getValue( AspectType.START_TIME);              }              if ( reportedResult.isDefined( AspectType.END_TIME)) {                estimatedEnd = reportedResult.getValue( AspectType.END_TIME);              }              AllocationResult newEstimatedResult = Utility.createAllocationResult( getFactory(), true,                                                                                    estimatedStart, estimatedEnd,                                                                                    estimatedCost, estimatedQuantity);              expansion.setEstimatedResult( newEstimatedResult);              publishChange( expansion);            } else {              Enumeration subtasks = workflow.getTasks();              Task lastSubtask = Utility.getLastSubtaskInWorkflow( workflow);              if ( shortfallCount < 0) {                // A negative shortfall means we have too many items.                // Remove the last subtask. We'll rework that one from scratch when this wakes back up.                ((NewWorkflow)workflow).removeTask( lastSubtask);                publishRemove( lastSubtask);                publishChange( workflow);                publishChange( expansion);              } else {                PlanElement planElement = lastSubtask.getPlanElement();                if ( !( planElement instanceof Allocation)) {                  expansion.setEstimatedResult( reportedResult);                  publishChange( expansion);                } else {                  Allocation allocation = (Allocation)lastSubtask.getPlanElement();                  // Need to determine if there is a "next" supplier.                  // Two cases:                  // 1. If this is the initial source mode, then the last supplier used was unable                  //    to completely fill the request. So, look for the next supplier in the suppliers list.                  // 2. If one of the already used suppliers has retracted one of the allocations, then the                  //    lastsupplier we used may still have more. Check him first if he did not previously                  //    report a shortfall.                  double lastSubtaskPrefQuantity = lastSubtask.getPreferredValue( AspectType.QUANTITY);                  AllocationResult lastSubtaskResult = allocation.getReportedResult();                  double lastSubtaskReportedQuantity = lastSubtaskResult.getValue( AspectType.QUANTITY);                  Organization lastSubtaskSupplier = (Organization)allocation.getAsset();                  Organization nextSupplier = (Organization)allocation.getAsset();                  if ( lastSubtaskReportedQuantity < lastSubtaskPrefQuantity) {                    nextSupplier = getNextSupplier( lastSubtask, lastSubtaskSupplier);                  }                  if ( nextSupplier != null) {                    NewTask subtask = Utility.cloneTask( getFactory(), lastSubtask, null);                    AspectValue quantityAV = AspectValue.newAspectValue( AspectType.QUANTITY, shortfallCount);                    ScoringFunction quantitySF = ScoringFunction.createNearOrBelow( quantityAV, shortfallCount);                    Preference quantityPreference = getFactory().newPreference( AspectType.QUANTITY, quantitySF);                    prefHelper.replacePreference( subtask, quantityPreference);                    NewPrepositionalPhrase newPhrase = getFactory().newPrepositionalPhrase();                    newPhrase.setPreposition( Grammar.USESUPPLIER);                    newPhrase.setIndirectObject( nextSupplier);                    prepHelper.replacePrepOnTask( subtask, newPhrase);                    boolean redirectToCluster = false;                    // If nextSupplier is myself, set the verb to SUPPLY.                    // If nextSupplier does not have role of MultipleSupplierCapable, set the verb to SUPPLY.                    // Otherwise, set the verb to SOURCE.                    if ( nextSupplier == Utility.findNamedOrganization( getClusterName(), getOrganizationAssets())) {                      subtask.setVerb( new Verb( Constants.Verb.SUPPLY));                    } else {                      subtask.setVerb( new Verb( Grammar.SOURCE));                    }                    ((NewWorkflow)workflow).addTask( subtask);                    subtask.setWorkflow( workflow);                    publishChange( workflow);                    publishAdd( subtask);                  } else {                    expansion.setEstimatedResult( reportedResult);                    publishChange( expansion);                  }                }              }            }          }        }      }    }  }