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;
 }
  /**
   * Method executeTask.
   *
   * @param object
   *     <p>incomingRequest
   */
  public Object executeTask(Object object) throws Exception {
    Object ret = null;
    try {
      Map incomingRequest = (Map) object;
      Contact contact = (Contact) incomingRequest.get("contact");
      String vendorId = "";

      if (contact != null) {
        vendorId = contact.getComp_id().getVendorId();
      }

      incomingRequest.put("Vendor_vendorId", vendorId);
      incomingRequest.put("Address_addressType", vendorId);
      incomingRequest.put("VendorCommRel_vendorId", vendorId);
      // for alternate contacts
      incomingRequest.put("Contact_vendorId", vendorId);
      incomingRequest.put("Contact_contactType", "ALTERNATE");
      // incomingRequest.put("Contact_contactCode", "002");

      this.setStatus(Status.SUCCEEDED);
    } catch (Exception e) {
      Log.error(this, e.toString());
      this.setStatus(Status.FAILED);
    }
    return ret;
  }
示例#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;
  }
 public static void main(String[] args) throws Exception {
   try {
     PuridiomProcessLoader processLoader = new PuridiomProcessLoader();
     PuridiomProcess process = processLoader.loadProcess("requisitionheader-add.xml");
     Map incomingRequest = new HashMap();
     // TODO add your parameters to incomingRequest here
     process.executeProcess(incomingRequest);
     System.out.println(incomingRequest);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
 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;
 }
示例#10
0
  public Object executeTask(Object object) throws Exception {
    Map incomingRequest = (Map) object;
    Object result = null;

    try {
      SendQueue sendQueue = (SendQueue) incomingRequest.get("sendQueue");
      if (sendQueue == null) {
        sendQueue = new SendQueue();
      }

      if (incomingRequest.containsKey("SendQueue_queueid")) {
        String queueidString = (String) incomingRequest.get("SendQueue_queueid");
        if (Utility.isEmpty(queueidString)) {
          queueidString = "0";
        }
        BigDecimal queueid = new BigDecimal(queueidString);
        sendQueue.setQueueid(queueid);
      }
      if (incomingRequest.containsKey("SendQueue_doctype")) {
        String doctype = (String) incomingRequest.get("SendQueue_doctype");
        sendQueue.setDoctype(doctype);
      }
      if (incomingRequest.containsKey("SendQueue_docic")) {
        String docicString = (String) incomingRequest.get("SendQueue_docic");
        if (Utility.isEmpty(docicString)) {
          docicString = "0";
        }
        BigDecimal docic = new BigDecimal(docicString);
        sendQueue.setDocic(docic);
      }
      if (incomingRequest.containsKey("SendQueue_subject")) {
        String subject = (String) incomingRequest.get("SendQueue_subject");
        sendQueue.setSubject(subject);
      }
      if (incomingRequest.containsKey("SendQueue_messagetext")) {
        String messagetext = (String) incomingRequest.get("SendQueue_messagetext");
        sendQueue.setMessage(messagetext);
      }
      if (incomingRequest.containsKey("SendQueue_messagetext2")) {
        String messagetext2 = (String) incomingRequest.get("SendQueue_messagetext2");
        sendQueue.setMessagetext2(messagetext2);
      }
      if (incomingRequest.containsKey("SendQueue_owner")) {
        String owner = (String) incomingRequest.get("SendQueue_owner");
        sendQueue.setOwner(owner);
      }
      if (incomingRequest.containsKey("SendQueue_sendfromtype")) {
        String sendfromtype = (String) incomingRequest.get("SendQueue_sendfromtype");
        sendQueue.setSendfromtype(sendfromtype);
      }
      if (incomingRequest.containsKey("SendQueue_sendfrom")) {
        String sendfrom = (String) incomingRequest.get("SendQueue_sendfrom");
        sendQueue.setSendfrom(sendfrom);
      }
      if (incomingRequest.containsKey("SendQueue_sendtotype")) {
        String sendtotype = (String) incomingRequest.get("SendQueue_sendtotype");
        sendQueue.setSendtotype(sendtotype);
      }
      if (incomingRequest.containsKey("SendQueue_sendto")) {
        String sendto = (String) incomingRequest.get("SendQueue_sendto");
        sendQueue.setSendto(sendto);
      }
      if (incomingRequest.containsKey("SendQueue_status")) {
        String status = (String) incomingRequest.get("SendQueue_status");
        sendQueue.setStatus(status);
      }
      if (incomingRequest.containsKey("SendQueue_dateadded")) {
        String dateadded = (String) incomingRequest.get("SendQueue_dateadded");
        sendQueue.setDateadded(dateadded);
      }
      if (incomingRequest.containsKey("SendQueue_timeadded")) {
        String timeadded = (String) incomingRequest.get("SendQueue_timeadded");
        sendQueue.setTimeadded(timeadded);
      }
      if (incomingRequest.containsKey("SendQueue_action")) {
        String action = (String) incomingRequest.get("SendQueue_action");
        sendQueue.setAction(action);
      }
      if (incomingRequest.containsKey("SendQueue_datesent")) {
        String datesent = (String) incomingRequest.get("SendQueue_datesent");
        sendQueue.setDatesent(datesent);
      }
      if (incomingRequest.containsKey("SendQueue_timesent")) {
        String timesent = (String) incomingRequest.get("SendQueue_timesent");
        sendQueue.setTimesent(timesent);
      }
      if (incomingRequest.containsKey("SendQueue_attachment")) {
        String attachment = (String) incomingRequest.get("SendQueue_attachment");
        sendQueue.setAttachment(attachment);
      }
      if (incomingRequest.containsKey("SendQueue_vendorId")) {
        String vendorId = (String) incomingRequest.get("SendQueue_vendorId");
        sendQueue.setVendorId(vendorId);
      }
      if (incomingRequest.containsKey("SendQueue_attempts")) {
        String attempts = (String) incomingRequest.get("SendQueue_attempts");
        if (Utility.isEmpty(attempts)) {
          attempts = "0";
        }
        sendQueue.setAttempts(new BigDecimal(attempts));
      }
      if (incomingRequest.containsKey("SendQueue_errorText")) {
        String errorText = (String) incomingRequest.get("SendQueue_errorText");
        sendQueue.setErrorText(errorText);
      }
      if (incomingRequest.containsKey("SendQueue_args")) {
        String args = (String) incomingRequest.get("SendQueue_args");
        sendQueue.setArgs(args);
      }

      result = sendQueue;
      this.status = Status.SUCCEEDED;
    } catch (Exception e) {
      this.status = Status.FAILED;

      e.printStackTrace();
      throw e;
    }
    return result;
  }
  /* (non-Javadoc)
   * @see com.tsagate.puridiom.process.ITask#executeTask(java.lang.Object)
   */
  public Object executeTask(Object object) throws Exception {

    Map incomingRequest = (Map) object;
    Object result = null;

    try {
      String organizationId = (String) incomingRequest.get("organizationId");
      String userDateFormat = (String) incomingRequest.get("userDateFormat");
      PropertiesManager propertiesManager = PropertiesManager.getInstance(organizationId);
      CatalogSecurity catalogSecurity = (CatalogSecurity) incomingRequest.get("catalogSecurity");
      String isCatalog = HiltonUtility.ckNull((String) incomingRequest.get("isCatalog"));
      String catalogId = (String) catalogSecurity.getCatalogId();
      String accesType = (String) catalogSecurity.getAccessType();
      String accessId = (String) catalogSecurity.getAccessId();

      if (HiltonUtility.isEmpty(userDateFormat)) {
        userDateFormat = propertiesManager.getProperty("MISC", "DateFormat", "MM-dd-yyyy");
      }

      String today = Dates.today(userDateFormat, (String) incomingRequest.get("userTimeZone"));

      if (isCatalog.equalsIgnoreCase("V")) {
        DBSession dbs = (DBSession) incomingRequest.get("dbsession");

        String queryString =
            "from CatalogSecurity as cs "
                + "where cs.catalogId = ? and cs.itemNumber != '0' "
                + "and cs.accessType = ? ";

        List resultList =
            dbs.query(
                queryString,
                new Object[] {catalogId, accesType},
                new Type[] {Hibernate.STRING, Hibernate.STRING});

        if (resultList != null && resultList.size() > 0) {
          for (int i = 0; i < resultList.size(); i++) {
            CatalogSecurity catalogItemSecurity = (CatalogSecurity) resultList.get(i);

            if (!accessId.equalsIgnoreCase(catalogItemSecurity.getAccessId())) {
              PuridiomProcessLoader processLoader =
                  new PuridiomProcessLoader((String) incomingRequest.get("organizationId"));
              PuridiomProcess process = processLoader.loadProcess("catalogsecurity-add.xml");

              Map updateParameters = new HashMap();

              updateParameters.put("organizationId", organizationId);
              updateParameters.put("dbsession", incomingRequest.get("dbsession"));

              updateParameters.put(
                  "CatalogSecurity_catalogId", (String) catalogSecurity.getCatalogId());
              updateParameters.put(
                  "CatalogSecurity_itemNumber", (String) catalogItemSecurity.getItemNumber());
              updateParameters.put(
                  "CatalogSecurity_accessType", (String) catalogSecurity.getAccessType());
              updateParameters.put(
                  "CatalogSecurity_accessId", (String) catalogSecurity.getAccessId());
              updateParameters.put("CatalogSecurity_owner", (String) catalogSecurity.getOwner());
              updateParameters.put("CatalogSecurity_dateEntered", today);
              updateParameters.put("CatalogSecurity_dateChanged", today);
              updateParameters.put(
                  "CatalogSecurity_lastChangedBy", (String) catalogSecurity.getCatalogId());

              process.executeProcess(updateParameters);

              catalogSecurity.setAccessId(accessId);

              dbs.add(catalogSecurity);
              if (dbs.getStatus() != Status.SUCCEEDED) {
                throw new TsaException(
                    "error ocurred at update catalog security from  for "
                        + catalogSecurity.getItemNumber());
              }
            }
          }
        }
      }

      this.setStatus(Status.SUCCEEDED);
    } catch (Exception e) {
      this.setStatus(Status.FAILED);
      Log.error(this, "An Error occurred at CatalogItemSecurityAddFromCatalog" + e);
      e.printStackTrace();
      throw e;
    }
    return result;
  }