thePG.addRefillRequisition(newRefill);  inventoryPlugin.publishRefillTask(newRefill, inv);
if (inventoryPlugin.publishRefillTask(newRefill, inv)) { thePG.addRefillRequisition(newRefill); } else { if (logger.isDebugEnabled()) { logger.debug("publishRefillTask returned false - not adding Refill task to the BG" + newRefill.getUID()); } }
  public void compareRefills(ArrayList newRefills, ArrayList oldRefills, Inventory inv) {    //Rescind all old Refill Tasks    Iterator oldIter = oldRefills.iterator();    while (oldIter.hasNext()) {      Task oldRefill = (Task) oldIter.next();      // check for a null in the refills list!      if (oldRefill != null) {	  // clean out the reference in the maintain inventory workflow	  ((NewWorkflow)oldRefill.getWorkflow()).removeTask(oldRefill);	inventoryPlugin.publishRemove(oldRefill);      }    }    //Process all new Refill Tasks    LogisticsInventoryPG thePG = (LogisticsInventoryPG)inv.	searchForPropertyGroup(LogisticsInventoryPG.class);    Iterator newIter = newRefills.iterator();    while (newIter.hasNext()) {      Task newRefill = (Task) newIter.next();      // apply the Task to the LogisticsInventoryBG      thePG.addRefillRequisition(newRefill);      // hook the task in with the MaintainInventory workflow and publish      inventoryPlugin.publishRefillTask(newRefill, inv);    }  }