Tuesday, February 6, 2024

OIC ERP - Create a Reusable Outbound integration | Run outbound interface reports to create outbound files

Usecase: Here, we will create n reusable outbound integration where we will call BI report using with name value paramters or without paramters and also can call ESS job (for daily or delta data fetch) and then create outbound files.

For delta data logic, follow below blog:

https://soalicious.blogspot.com/2021/05/oic-ess-job-run-for-delta-calculation.html


Implementation steps:

  1. Create a schedule orchestration and below schedule parameters with sample values
    1. p_encryptFlag : Y or N
    2. p_essJobName : "oracle/apps/ess/custom/delta,FIn_Sample_ERP_ESS;p_event=PT:p_destination: full path;p_fileName= filename:p_ext=.xlsx,p_format=xssx"
    3. p_fileName: filename.xlsx
    4. p_outboundPath: where we will place outbound file
    5. p_reportPath: Custom/Integrations/Outbound/GL/FIN_GL_RECON_ERP_BLK_BI.xdo;p_event=pt
  2. Take a scope body
  3. Assign globals
    1. fileName : concat(substring($p_fileName,1.0, index-within-string($p_fileName,".")),"_",year-from-date( current-date()),month-fromdate(current-date()),day-from-date(current-date()),"_", hours-from-dateTime(current-dateTime()), minutes-from-dateTime(current-dateTime()),integer(seconds-from-dateTime(current-dateTime())),substring($p_fileName, index-within-string($p_fileName,".")+1.0,5.0))
    2. jobPackage : ""
    3. jobDefinition : ""
    4. fileReference : ""
    5. paramFileName : "Parameters.csv"
    6. paramFileDir : "/parameters"
    7. essParamFileName : "ESSParameters.csv"
    8. essParamFileDir : "/essParameters"
  4. Check if p_reportPath contains ";" it means it contains some parameters
    1. If yes:  fetch name values paramters and retry 5 time and call BI report to fetch the report.
      1. Fetch name values paramters.(https://soalicious.blogspot.com/2021/05/oic-params.html)
      2. Read paramter csv file using stage
      3. Take assign  
        1. retryCount = 0.0
        2. fileReference = "NONE"
      4. Take a while with condition as $retrycount <=4.0 and $fileReference ="NONE"
        1. Take a switch and check if $retrycount >=2.0 then wait 20sec
        2. Configure BI report call for runReport operation (we should have a soap connection for ExternalReportWSSService)
        3. Map the following:
          1. p_reportName as reportAbsolutePath and -1 as sizeOfDataChunkDownload.
          2. Map the readParams c1 and c2 to paramterNameValues
        4. Take assign fileReference = reportBytes
        5. Take assign and update retry count : $retryCount =retrycount +1
      5. Switch if fileReference = NONE throw new fault as "Error while dispatching SOAP messagw to the endpoint "
    2. If no: retry 5 times and call BI report to fetch the report.
      1. Take assign  
        1. retryCount = 0.0
        2. fileReference = "NONE"
      2. Take a while with condition as $retrycount <=4.0 and $fileReference ="NONE"
        1. Take a switch and check if $retrycount >=2.0 then wait 20sec
        2. Configure BI report call for runReport operation (we should have a soap connection for ExternalReportWSSService)
        3. Map the p_reportName as reportAbsolutePath and -1 as sizeOfDataChunkDownload.
        4. Take assign fileReference = reportBytes
        5. Take assign and update retry count : $retryCount =retrycount +1
      3. Switch if fileReference = NONE throw new fault as "Error while dispatching SOAP messagw to the endpoint "
  5. Check if p_encryptFlag = Y then encrypt the data fetched from BI call
      1. Take assign and deocde base64 to file reference. fileReference = decodeBase64ToReference($fileReference)
      2. Take stage and encrypt using Pgp key, fileReference and fileName (for pgp key details: https://soalicious.blogspot.com/2021/08/oic-import-pgp-keys-to-use-in-stage.html)
      3. Take assign and encode back to base64. fileReference = encodeReferenceToBase64(fileReference)
  6. Check if p_ESSJobName != "" or != "null" then

      1. Check if contains($p_essJobName,";") = true then
        1. Fetch required params values and call ESS job
          1. Fetch only values of paramters and save in a csv file(https://soalicious.blogspot.com/2021/05/oic-params.html)
          2. Read the csv file using stage
          3. Submit ess job request using erp adapter erpIntegrationService
          4. Monitor the ess job status
          5. If anything failed for monitor child integration , will throw a new fault.
      2. Else,
        1. Call the ess job without parameters and monitor thr ess job status
          1. Update job params:
            1. jobDefinition: substring-after($p_essJobName,",")
            2. jobPackage: substring-before($p_essJobName,",")
          2. Configure Oracle Cloud adpater erpIntegrationService and submitEssJobRequest operation
          3. Map the job definition and job package.
          4. Monitor the ess job.(https://soalicious.blogspot.com/2024/01/oic-erp-monitor-progress-of-ess-job-and.html)
  1. Move the file to Outbound location: Call child integration and move file to respective folder. https://soalicious.blogspot.com/2023/12/oic-create-resuable-integration-to.html

No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...