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:
- Configure rest request with post verb. Request json payload spacified above.
- Assign looping variables like
- LoopCounter = -45.0
- ESS_Status = ""
- MaxLoopCount = 9
- Take a while loop with condition $Loopcounter < $MaxLoopCount and $ESS_Status != "SUCCEEDED"
- Call Erp cloud adapter - operation: getESSJobStatus and service : erpIntegrationService and map request Id.
- Wait 59 sec
- Assign status like
- LoopCounter = Loopcounter +1
- ESS_Status = result of the getESSJobStatus
- Take a switch and check if ESS_Status = SUCCEEDED
- If yes,
- Call erp cloud adapter and download control report using service: erpIntegrationService and operation: downloadESSJobExecutionDetails. And map request id
- Write control reports to stage location using sourceFileName, temp stage location and using opaque schema and map the content to opaque element.
- Unzip the zipped contents using stage
- Read text control report using stage and xsd opaque file. Specifying file name as unzipcontrolreport/properties[filetype='text']/filename
- 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.
- If no, throw new fault with code, reason, details.
Sceenshots:
TBD
No comments:
Post a Comment