newRefill.setDirectObject(inv);
newRefill.setDirectObject(thePG.getResource());
  private Task createRefillTask(double quantity, long endDay,                                 Inventory inv, LogisticsInventoryPG thePG,                                 long today, int ost) {    // make a new task    NewTask newRefill = inventoryPlugin.getRootFactory().newTask();    newRefill.setVerb(Constants.Verb.Supply);    newRefill.setDirectObject(inv);    //set the commitment date to endDay - ost.    newRefill.setCommitmentDate(new Date(getTimeUtils().subtractNDays(endDay, ost)));    // create preferences    Vector prefs = new Vector();    Preference p_end,p_qty;    p_end = createRefillTimePreference(endDay, today);    p_qty = createRefillQuantityPreference(quantity);    prefs.add(p_end);    prefs.add(p_qty);    newRefill.setPreferences(prefs.elements());    //create Prepositional Phrases    Vector pp_vector = new Vector();    pp_vector.add(createPrepPhrase(Constants.Preposition.FOR, getOrgName()));    pp_vector.add(createPrepPhrase(Constants.Preposition.OFTYPE, 					 inventoryPlugin.getSupplyType()));    Object io;    Enumeration geolocs = getAssetUtils().      getGeolocLocationAtTime(getMyOrganization(), endDay);    if (geolocs.hasMoreElements()) {      io = (GeolocLocation)geolocs.nextElement();    } else {	io = getHomeLocation();    }    pp_vector.add(createPrepPhrase(Constants.Preposition.TO, io));    Asset resource = thePG.getResource();    TypeIdentificationPG tip = ((Asset)resource).getTypeIdentificationPG();    MaintainedItem itemID = MaintainedItem.      findOrMakeMaintainedItem("Inventory", tip.getTypeIdentification(),                               null, tip.getNomenclature(), inventoryPlugin);    pp_vector.add(createPrepPhrase(Constants.Preposition.MAINTAINING, itemID));    pp_vector.add(createPrepPhrase(Constants.Preposition.REFILL, null));    newRefill.setPrepositionalPhrases(pp_vector.elements());    return newRefill;  }