Tuesday, August 16, 2022

OIC to ERP : Move custom report | download custom report based on ess job id and then move to desired folder

Usecase: Here, we will create a sub integration which will take a request id and check if ESS job status, if its succceeded, it will download the report and move the file to desired mail dl or sftp directory.

HighLevel steps:

  • Main flow (where import and child process runs) call to callback integration
  • Archive the success file
  • Execute the execution accounting report based on child request id for support help.
  • Call ESS job which internally calls the BI report to execute the SQL query to get the callback report
  • Call a Sub Integration like MoveCTRLReport and feed the ESS job process id
    • Here, check the ESS job status using getESSJobStatus(Interesting fact is that we are looping max 55 times to check if the ESS process completes )
    • If ESS process gets completed,
      • Download the control report using downloadESSJobExecutionDetails operation
      • Write the control report in stage
      • Unzip the report
      • Read the text report
      • Move the report to FTP location

Request payload:

{

"RequestId":"",

"directoryAdapter":"",

"sourceFileName":"",

"targetDirectory":""

}

Implementation logic steps:

  1. Configure rest request with post verb. Request json payload spacified above.
  2. Assign looping variables like
    1. LoopCounter = -45.0
    2. ESS_Status = ""
    3. MaxLoopCount = 9
  3. Take a while loop with condition $Loopcounter < $MaxLoopCount and $ESS_Status != "SUCCEEDED"
    1. Call Erp cloud adapter - operation: getESSJobStatus and service : erpIntegrationService and map request Id.
    2. Wait 59 sec
    3. Assign status like
      1. LoopCounter = Loopcounter +1
      2. ESS_Status = result of the getESSJobStatus
  4. Take a switch and check if ESS_Status = SUCCEEDED 
    1. If yes,
      1. Call erp cloud adapter and download control report using service: erpIntegrationService and operation: downloadESSJobExecutionDetails. And map request id
      2. Write control reports to stage location using sourceFileName, temp stage location and using opaque schema and map the content to opaque element.
      3. Unzip the zipped contents using stage
      4. Read text control report using stage and xsd opaque file. Specifying file name as unzipcontrolreport/properties[filetype='text']/filename
      5. Call another sub integration like OIC_File_Handler to move the control report to desired sftp or s3 folder. Or send a mail attaching the report.
    2. If no, throw new fault with code, reason, details.
Sceenshots:
TBD

No comments:

Post a Comment

Featured Post

OIC - Commonly Used XSLT Functions in Oracle Integration Cloud (OIC)

In Oracle Integration Cloud (OIC), the most commonly used XSLT functions are primarily focused on transforming, filtering, and manipulating ...