public static void main(String[] args) throws Exception {
    try {
      DocAttachmentRetrieveByHeaderHandler test = new DocAttachmentRetrieveByHeaderHandler();
      Map incomingRequest = new HashMap();

      incomingRequest.put("organizationId", "PURIDIOM");
      incomingRequest.put("userId", "KELLI");
      incomingRequest.put("DocAttachment_icHeader", "123");
      incomingRequest.put("successPage", "SUCCESS");
      incomingRequest.put("failurePage", "FAILURE");

      test.handleRequest(incomingRequest);
      System.out.println(incomingRequest);

      String viewPage = (String) incomingRequest.get("viewPage");
      if (viewPage != null && viewPage.equals("SUCCESS")) {
        System.out.println("DocAttachmentRetrieveByHeaderHandler - SUCCESS");
      }

      List list = (List) incomingRequest.get("docAttachmentList");
      for (int i = 0; i < list.size(); i++) {
        DocAttachment docAttachment = (DocAttachment) list.get(i);
        System.out.println(i + " - " + docAttachment.toString());
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Example #2
0
  public static void main(String[] args) throws Exception {
    try {
      RfqLineCreateHandler test = new RfqLineCreateHandler();
      Map incomingRequest = new HashMap();

      incomingRequest.put("organizationId", "PURIDIOM");
      incomingRequest.put("userId", "KELLI");
      incomingRequest.put("RfqHeader_icRfqHeader", "1145085800000");
      incomingRequest.put("createAction", "SAVE");
      incomingRequest.put("successPage", "SUCCESS");
      incomingRequest.put("failurePage", "FAILURE");

      test.handleRequest(incomingRequest);
      System.out.println(incomingRequest);

      String viewPage = (String) incomingRequest.get("viewPage");
      if (viewPage != null && viewPage.equals("SUCCESS")) {
        System.out.println("RfqLineCreate - SUCCESS");
      }
      RfqLine rfqLine = (RfqLine) incomingRequest.get("rfqLine");
      System.out.println(rfqLine.getRfqLine() + " - " + rfqLine.getItemNumber());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public void funcioncall() {
    try {
      AccountAllocAmountRetrieveHandler test = new AccountAllocAmountRetrieveHandler();
      Map incomingRequest = new HashMap();

      incomingRequest.put("organizationId", "TEST");
      incomingRequest.put("userId", "hiltontest");
      incomingRequest.put("icHeader", "4930180800007");
      incomingRequest.put("successPage", "SUCCESS");
      incomingRequest.put("failurePage", "FAILURE");

      test.handleRequest(incomingRequest);
      System.out.println(incomingRequest);

      String viewPage = (String) incomingRequest.get("viewPage");
      if (viewPage != null && viewPage.equals("SUCCESS")) {
        System.out.println("Account - SUCCESS");
      }

      System.out.println("Tarea terminada");

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  /* (non-Javadoc)
   * @see com.tsa.puridiom.process.ITask#executeTask(java.lang.Object)
   */
  public Object executeTask(Object object) throws Exception {
    Map incomingRequest = (Map) object;

    try {
      String userId = (String) incomingRequest.get("userId");
      String organizationId = (String) incomingRequest.get("organizationId");

      incomingRequest.put("UserProfile_userId", userId);
      incomingRequest.put("UserProfile_organizationId", organizationId);

      this.status = Status.SUCCEEDED;
    } catch (Exception e) {
      this.status = Status.FAILED;
      throw e;
    }
    return null;
  }
  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);
    }
  }
Example #6
0
 /**
  * Method executeTask.
  *
  * @param object
  *     <p>incomingRequest
  * @author EDSAC returns a copy of asset with tagNumber changed, trackingNumber "N/A" and status
  *     Pending in a list
  */
 public Object executeTask(Object object) throws Exception {
   Map incomingRequest = (Map) object;
   List assetList = new ArrayList();
   try {
     Asset asset = (Asset) incomingRequest.get("asset");
     Asset assetClon =
         new Asset(
             asset.getAssetClass(),
             asset.getSecurityCode(),
             asset.getCommodity(),
             asset.getManufacturer(),
             asset.getModel(),
             asset.getSerialNumber(),
             asset.getAssetCost(),
             asset.getDateInService(),
             asset.getDeprecMethod(),
             asset.getWarrantyStart(),
             asset.getWarrantyEnd(),
             asset.getUpgradeReqs(),
             asset.getContractService(),
             asset.getPurchaseOrder(),
             asset.getDateEntered(),
             asset.getAssetStatus(),
             asset.getAssetUdf1(),
             asset.getAssetUdf2(),
             asset.getAssetUdf3(),
             asset.getAssetUdf4(),
             asset.getAssetUdf5(),
             asset.getTotalCost(),
             asset.getIcText(),
             asset.getImageFile(),
             asset.getPoVendor(),
             asset.getContractorName(),
             asset.getOwner(),
             asset.getDeprecTerm(),
             asset.getDateReceived(),
             asset.getIcReceipt(),
             asset.getAssetUdf6(),
             asset.getAssetUdf7(),
             asset.getAssetUdf8(),
             asset.getAssetUdf9(),
             asset.getAssetUdf10(),
             asset.getIcLineKey(),
             asset.getItemNumber(),
             asset.getItemLocation(),
             asset.getIcAccount(),
             asset.getIcDsbHeader(),
             asset.getIcDsbLine(),
             asset.getLocalCurrencyPrice(),
             asset.getOriginalCost(),
             asset.getExitValue(),
             asset.getDateInactive(),
             asset.getLastChgBy(),
             asset.getDateChanged(),
             asset.getDescription(),
             asset.getLease(),
             asset.getLeaseType(),
             asset.getLeaseTerm(),
             asset.getMonthlyPayment(),
             asset.getLeasingCompany(),
             asset.getRenewalDate(),
             asset.getFinancing(),
             asset.getPrinted(),
             asset.getTrackingNumber(),
             asset.getFiscalYear());
     assetClon.setTagNumber(UniqueKeyGenerator.getInstance().getUniqueKey().toString());
     assetClon.setAssetStatus("Pending");
     assetClon.setTrackingNumber("N/A");
     assetList.add(assetClon);
   } catch (Exception e) {
     Log.error(this, e.toString());
     this.setStatus(Status.FAILED);
   }
   return assetList;
 }
  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;
  }