@Override
 protected void addRoleQualification(Object businessObject, Map<String, String> attributes) {
   super.addRoleQualification(businessObject, attributes);
   attributes.put(PurapKimAttributes.DOCUMENT_SENSITIVE, "false");
   ElectronicInvoiceRejectDocument purapDoc = (ElectronicInvoiceRejectDocument) businessObject;
   if (purapDoc.getAccountsPayablePurchasingDocumentLinkIdentifier() != null) {
     List<SensitiveData> sensitiveDataList =
         SpringContext.getBean(SensitiveDataService.class)
             .getSensitiveDatasAssignedByRelatedDocId(
                 purapDoc.getAccountsPayablePurchasingDocumentLinkIdentifier());
     StringBuffer sensitiveDataCodes = new StringBuffer();
     for (SensitiveData sensitiveData : sensitiveDataList) {
       sensitiveDataCodes.append(sensitiveData.getSensitiveDataCode()).append(";");
     }
     if (sensitiveDataCodes.length() > 0) {
       attributes.put(PurapKimAttributes.DOCUMENT_SENSITIVE, "true");
       attributes.put(
           PurapKimAttributes.SENSITIVE_DATA_CODE,
           sensitiveDataCodes.toString().substring(0, sensitiveDataCodes.length() - 1));
       attributes.put(
           PurapKimAttributes.ACCOUNTS_PAYABLE_PURCHASING_DOCUMENT_LINK_IDENTIFIER,
           purapDoc.getAccountsPayablePurchasingDocumentLinkIdentifier().toString());
     }
   }
 }
  protected boolean processBusinessRules(Document document) {
    boolean isValid = true;

    ElectronicInvoiceRejectDocument eirDocument = (ElectronicInvoiceRejectDocument) document;

    // check to see if the document is being researched
    if (eirDocument.isInvoiceResearchIndicator()) {
      GlobalVariables.getMessageMap()
          .putError(
              KFSConstants.DOCUMENT_ERRORS, PurapConstants.REJECT_DOCUMENT_RESEARCH_INCOMPETE);
      isValid = false;
    }

    if (!eirDocument.isDocumentCreationInProgress()) {
      isValid =
          isValid
              && SpringContext.getBean(ElectronicInvoiceHelperService.class)
                  .doMatchingProcess(eirDocument);
      if (isValid) {
        SpringContext.getBean(ElectronicInvoiceHelperService.class)
            .createPaymentRequest(eirDocument);
      }
    }

    return isValid;
  }