/**
   * 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;
  }
Ejemplo n.º 2
0
  private String acknowledgedReceipt(ApprovalLink approvalLink, String organizationId)
      throws Exception {
    String message = "";
    PuridiomProcessLoader processLoader = new PuridiomProcessLoader(organizationId);
    PuridiomProcess process = processLoader.loadProcess("po-supplier-acknowledgement.xml");
    Map incomingRequest = new HashMap();
    Contact contact;
    String[] contactData;

    if (approvalLink.getDoctype().equalsIgnoreCase("PO")) {
      incomingRequest.put("PoHeader_icPoHeader", approvalLink.getIcHeader().toString());

      contactData = approvalLink.getUserId().split("//");

      contact = this.getVendorContact(contactData[0], contactData[1], organizationId);

      incomingRequest.put("userName", contact.getDisplayName());
      incomingRequest.put("userId", contact.getEmailAddr());
    }

    incomingRequest.put("organizationId", organizationId);

    process.executeProcess(incomingRequest);

    return message;
  }