public Object executeTask(Object object) throws Exception {
    Map incomingRequest = (Map) object;

    try {
      List poLineList = (List) incomingRequest.get("poLineList");
      List reqLineList = new ArrayList();
      String icPoHeader = (String) incomingRequest.get("PoHeader_icPoHeader");
      PuridiomProcessLoader processLoader =
          new PuridiomProcessLoader((String) incomingRequest.get("organizationId"));
      PuridiomProcess process = processLoader.loadProcess("requisitionline-create-from-poline.xml");
      HashMap updateParameters = new HashMap();

      updateParameters.put("userId", incomingRequest.get("userId"));
      updateParameters.put("userTimeZone", incomingRequest.get("userTimeZone"));
      updateParameters.put("organizationId", incomingRequest.get("organizationId"));
      updateParameters.put("dbsession", incomingRequest.get("dbsession"));
      updateParameters.put(
          "RequisitionHeader_icReqHeader", incomingRequest.get("RequisitionHeader_icReqHeader"));
      updateParameters.put(
          "RequisitionHeader_icRevisedOrder",
          incomingRequest.get("RequisitionHeader_icRevisedOrder"));
      updateParameters.put(
          "RequisitionHeader_requisitionNumber",
          incomingRequest.get("RequisitionHeader_requisitionNumber"));
      updateParameters.put("requisitionHeader", incomingRequest.get("requisitionHeader"));

      for (int i = 0; i < poLineList.size(); i++) {
        PoLine poLine = (PoLine) poLineList.get(i);

        updateParameters.put("poLine", poLine);

        process.executeProcess(updateParameters);

        if (process.getStatus() == Status.SUCCEEDED) {
          reqLineList.add(updateParameters.get("requisitionLine"));

          updateParameters.remove("requisitionLine");
          updateParameters.remove("poLine");
        } else {
          this.setStatus(process.getStatus());
          throw new Exception("Process to create requisition lines from po lines failed.");
        }
      }

      incomingRequest.put("PoLine_icPoHeader", icPoHeader);

      this.setStatus(Status.SUCCEEDED);
    } catch (Exception e) {
      this.setStatus(Status.FAILED);
      throw e;
    }

    return null;
  }
Exemplo n.º 2
0
 public Map handleRequest(Map incomingRequest) throws Exception {
   try {
     PuridiomProcessLoader processLoader =
         new PuridiomProcessLoader((String) incomingRequest.get("organizationId"));
     PuridiomProcess process = processLoader.loadProcess("vendor-deletebyid.xml");
     process.executeProcess(incomingRequest);
     if (process.getStatus() == Status.SUCCEEDED) {
       String errorMsg = (String) incomingRequest.get("deleteVendorErrorMsg");
       if (errorMsg != null && errorMsg.trim().length() > 0) {
         incomingRequest.put("viewPage", incomingRequest.get("deleteVendorFailurePage"));
       } else {
         incomingRequest.put("viewPage", incomingRequest.get("successPage"));
       }
     } else {
       incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
     }
   } catch (Exception exception) {
     incomingRequest.put("errorMsg", exception.getMessage());
     incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
     throw exception;
   } finally {
     if (incomingRequest.get("viewPage") == null) {
       incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
     }
   }
   return incomingRequest;
 }
Exemplo n.º 3
0
 public Map handleRequest(Map incomingRequest) throws Exception {
   try {
     PuridiomProcessLoader processLoader =
         new PuridiomProcessLoader((String) incomingRequest.get("organizationId"));
     PuridiomProcess process = processLoader.loadProcess("currcode-add.xml");
     process.executeProcess(incomingRequest);
     if (process.getStatus() == Status.SUCCEEDED) {
       String errorMsg = (String) incomingRequest.get("duplicateCurrCodeErrorMsg");
       if (errorMsg != null && errorMsg.trim().length() > 0) {
         incomingRequest.put("viewPage", incomingRequest.get("duplicateCurrCodeFailurePage"));
       } else {
         incomingRequest.put("viewPage", incomingRequest.get("successPage"));
         /*
          *  kathleen added the following on 06-16-05
          *  so that after a currency code record is successfully added
          *  the user gets returned back to the currency code browse
          *  (browseName is declared on the jsp)
          */
         process = processLoader.loadProcess("browse-retrieve.xml");
         process.executeProcess(incomingRequest);
       }
     } else {
       incomingRequest.put("viewPage", (String) incomingRequest.get("failurePage"));
     }
   } catch (Exception exception) {
     incomingRequest.put("errorMsg", exception.getMessage());
     incomingRequest.put("viewPage", (String) incomingRequest.get("failurePage"));
     throw exception;
   } finally {
     if (incomingRequest.get("viewPage") == null) {
       incomingRequest.put("viewPage", (String) incomingRequest.get("failurePage"));
     }
   }
   return incomingRequest;
 }
  public Map handleRequest(Map incomingRequest) throws Exception {
    try {
      String organizationId = (String) incomingRequest.get("organizationId");
      PuridiomProcessLoader processLoader = new PuridiomSupplierPortalProcessLoader(organizationId);
      PuridiomProcess process = processLoader.loadProcess("vendorregister-validate.xml");
      process.executeProcess(incomingRequest);

      if (process.getStatus() == Status.SUCCEEDED) {
        incomingRequest.put("viewPage", incomingRequest.get("successPage"));
      } else {
        incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
      }
    } catch (Exception exception) {
      incomingRequest.put("errorMsg", exception.getMessage());
      incomingRequest.put("exception", exception);
      incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
      //			throw exception;
    } finally {
      if (incomingRequest.get("viewPage") == null) {
        incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
      }
    }

    return incomingRequest;
  }
Exemplo n.º 5
0
 public Map handleRequest(Map incomingRequest) throws Exception {
   try {
     PuridiomProcessLoader processLoader = new PuridiomProcessLoader();
     PuridiomProcess process = processLoader.loadProcess("invmethod-update.xml");
     process.executeProcess(incomingRequest);
     if (process.getStatus() == Status.SUCCEEDED) {
       incomingRequest.put("viewPage", (String) incomingRequest.get("successPage"));
     } else {
       incomingRequest.put("viewPage", (String) incomingRequest.get("failurePage"));
     }
   } catch (Exception exception) {
     incomingRequest.put("errorMsg", exception.getMessage());
     incomingRequest.put("viewPage", (String) incomingRequest.get("failurePage"));
     throw exception;
   } finally {
     if (incomingRequest.get("viewPage") == null) {
       incomingRequest.put("viewPage", (String) incomingRequest.get("failurePage"));
     }
   }
   return incomingRequest;
 }
  public static void main(String[] args) {
    try {
      System.out.println("Delete catalogComopnent record");
      PuridiomProcessLoader processLoader = new PuridiomProcessLoader();
      PuridiomProcess process = processLoader.loadProcess("catalogComponent-delete.xml");
      Map incomingRequest = new HashMap();

      incomingRequest.put("catalogID", "936");
      incomingRequest.put("itemNumber", "10");
      incomingRequest.put("sequence", new Integer(1));

      process.executeProcess(incomingRequest);

      CatalogComponent catalogComponent =
          (CatalogComponent) incomingRequest.get("catalogcomponentdelete");
      System.out.println("status: " + process.getStatus());
      System.out.println("end of catalogPriceBrk Delete process test");
    } catch (Exception exception) {
      exception.printStackTrace();
      ErrorHandlingService ehs = ErrorHandlingService.getInstance();
      ehs.handleException("catalogComponentDeleteTest", "executeTask", null, exception);
    }
  }
 public Map handleRequest(Map incomingRequest) throws Exception {
   try {
     PuridiomProcessLoader processLoader =
         new PuridiomProcessLoader((String) incomingRequest.get("organizationId"));
     PuridiomProcess process = processLoader.loadProcess("labels-delete-by-id-refresh.xml");
     process.executeProcess(incomingRequest);
     if (process.getStatus() == Status.SUCCEEDED) {
       incomingRequest.put("viewPage", incomingRequest.get("successPage"));
     } else {
       incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
     }
   } catch (Exception exception) {
     incomingRequest.put("errorMsg", exception.getMessage());
     incomingRequest.put("exception", exception);
     incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
     throw exception;
   } finally {
     if (incomingRequest.get("viewPage") == null) {
       incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
     }
   }
   return incomingRequest;
 }
 public Map handleRequest(Map incomingRequest) throws Exception {
   try {
     PuridiomProcessLoader processLoader =
         new PuridiomSupplierPortalProcessLoader((String) incomingRequest.get("organizationId"));
     PuridiomProcess process =
         processLoader.loadProcess("suppliercerts-checklistentry-retrieve-by-referencetype.xml");
     incomingRequest.put("ChecklistEntry_referenceType", "VCT");
     process.executeProcess(incomingRequest);
     if (process.getStatus() == Status.SUCCEEDED) {
       incomingRequest.put("viewPage", incomingRequest.get("successPage"));
     } else {
       incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
     }
   } catch (Exception exception) {
     incomingRequest.put("errorMsg", exception.getMessage());
     incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
     throw exception;
   } finally {
     if (incomingRequest.get("viewPage") == null) {
       incomingRequest.put("viewPage", incomingRequest.get("failurePage"));
     }
   }
   return incomingRequest;
 }