Gyaaan on : ERP Integration Service

ERP Integration Service

Provides external operations for ERP integration scenarios to execute end-to-end inbound and outbound data flows. It also tracks the status of inbound and outbound data processes.

Service WSDL URL: https://(FADomain,FSCMServices)/fscmService/ErpIntegrationService?WSDL

Lets check how to invoke this to perform UCM Upload and Import Job Operation

Following is the Java Method used to uploadfile to UCM – The below method returns the ucmID – using which we can call the Import Process

  public String uploadFileToUcm(String filePath, String filename,
                                String contentType, String docTitle,
                                String docAuthor,
                                String docAccount) throws Exception {

      System.out.println("Entered uploadFileToUcm");
      String resp = null;
      try {
          URL wsdl = new URL(wsdlURL);

          QName serviceName = new QName(xmlNameSpace, name);
          erpIntegrationService_Service =
                  new ErpIntegrationService_Service(wsdl, serviceName);
          SecurityPolicyFeature[] securityFeatures =
              new SecurityPolicyFeature[] { new SecurityPolicyFeature("policy:oracle/wss_username_token_over_ssl_client_policy") };
          erpIntegrationService =
                  erpIntegrationService_Service.getErpIntegrationServiceSoapHttpPort(securityFeatures);
          Map<String, Object> reqContext =
              ((BindingProvider)erpIntegrationService).getRequestContext();
          reqContext.put(BindingProvider.USERNAME_PROPERTY, userName);
          reqContext.put(BindingProvider.PASSWORD_PROPERTY, passwd);
          ObjectFactory objectFactory = new ObjectFactory();
          DocumentDetails docDetails = new DocumentDetails();
          docDetails.setContent(getByteArray(filePath + File.separatorChar +
                                             filename));
          docDetails.setFileName(filename);
          docDetails.setContentType(objectFactory.createDocumentDetailsContentType(contentType));

          docDetails.setDocumentTitle(objectFactory.createDocumentDetailsDocumentTitle(docTitle));
          docDetails.setDocumentAuthor(objectFactory.createDocumentDetailsDocumentAuthor(docAuthor));
          docDetails.setDocumentSecurityGroup(objectFactory.createDocumentDetailsDocumentSecurityGroup("FAFusionImportExport"));
          docDetails.setDocumentAccount(objectFactory.createDocumentDetailsDocumentAccount(docAccount));
          resp = erpIntegrationService.uploadFileToUcm(docDetails);

      } catch (Exception e) {
          throw e;
                          }
      System.out.println("Return From uploadFileToUcm");
      return resp;
  }

Following is the code snippet to invoke the Import job, this should work for any import job, provided there is a need to update the job details. Below method returns the ESS Job ID

//Load File Into Interface Tables 
            String jobPackageName="/oracle/apps/ess/financials/commonModules/shared/common/interfaceLoader";
        String jobDefinitionName="InterfaceLoaderController";
        List paramList=new ArrayList();
        paramList.add("54");
        paramList.add(ucmProcessId);    try 
        {
            reqId =  erpIntegrationService.submitESSJobRequest(jobPackageName,
                                         jobDefinitionName,
                                         paramList );
        } 

    catch (ServiceException e)
    {  
         System.out.println("Exception in Invoking-->InterfaceLoaderController");
    }

Use the below logic to validate the status of the ESSJobID

              try {
                  status = erpIntegrationService.getESSJobStatus(reqId);
              } catch (ServiceException e) {
              }
              System.out.println("Status of Interface load is: " +
                                   status);
                if (status != null) {
                    if (status.equalsIgnoreCase("Succeeded") ||
                        status.equalsIgnoreCase("Error") ||
                        status.equalsIgnoreCase("Warning") ||
                        status.equalsIgnoreCase("Canceled"))
                        break;
                }
            }   

Let’s see another method about to get the log/output of ess Job . This method requires two parameter. one is RequestID and other is file type.

The file type to determine the execution details to download. Specify the file type as log to download the log and output file. Specify the file type as out to download the output file. When no file type is specified, both the log files and output files are downloaded.

List<DocumentDetails> docDetails = financialUtilService.downloadESSJobExecutionDetails(RequestId.toString(), "out");
for(DocumentDetails documentDetails : docDetails )
{
System.out.println("Account: "+documentDetails.getDocumentAccount().getValue());
System.out.println("File Name: "+documentDetails.getFileName().getValue());
System.out.println("Document Title: "+documentDetails.getDocumentTitle().getValue());
System.out.println("DocumentName " + documentDetails.getDocumentName().getValue());
System.out.println("ContentType " + documentDetails.getContentType().getValue());
System.out.println("Content-Value: "+documentDetails.getContent().getValue());
System.out.println("Content: "+documentDetails.getContent());
System.out.println("Document Security Group: "+documentDetails.getDocumentSecurityGroup().getValue());
System.out.println("Document Author: "+documentDetails.getDocumentAuthor().getValue());
}

Leave a Reply

Your email address will not be published.