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:
- Create a schedule orchestration and below schedule parameters with sample values
- p_encryptFlag : Y or N
- 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"
- p_fileName: filename.xlsx
- p_outboundPath: where we will place outbound file
- p_reportPath: Custom/Integrations/Outbound/GL/FIN_GL_RECON_ERP_BLK_BI.xdo;p_event=pt
- Take a scope body
- Assign globals
- 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))
- jobPackage : ""
- jobDefinition : ""
- fileReference : ""
- paramFileName : "Parameters.csv"
- paramFileDir : "/parameters"
- essParamFileName : "ESSParameters.csv"
- essParamFileDir : "/essParameters"
- Check if p_reportPath contains ";" it means it contains some parameters
- If yes: fetch name values paramters and retry 5 time and call BI report to fetch the report.
- Fetch name values paramters.(https://soalicious.blogspot.com/2021/05/oic-params.html)
- Read paramter csv file using stage
- Take assign
- retryCount = 0.0
- fileReference = "NONE"
- Take a while with condition as $retrycount <=4.0 and $fileReference ="NONE"
- Take a switch and check if $retrycount >=2.0 then wait 20sec
- Configure BI report call for runReport operation (we should have a soap connection for ExternalReportWSSService)
- Map the following:
- p_reportName as reportAbsolutePath and -1 as sizeOfDataChunkDownload.
- Map the readParams c1 and c2 to paramterNameValues
- Take assign fileReference = reportBytes
- Take assign and update retry count : $retryCount =retrycount +1
- Switch if fileReference = NONE throw new fault as "Error while dispatching SOAP messagw to the endpoint "
- If no: retry 5 times and call BI report to fetch the report.
- Take assign
- retryCount = 0.0
- fileReference = "NONE"
- Take a while with condition as $retrycount <=4.0 and $fileReference ="NONE"
- Take a switch and check if $retrycount >=2.0 then wait 20sec
- Configure BI report call for runReport operation (we should have a soap connection for ExternalReportWSSService)
- Map the p_reportName as reportAbsolutePath and -1 as sizeOfDataChunkDownload.
- Take assign fileReference = reportBytes
- Take assign and update retry count : $retryCount =retrycount +1
- Switch if fileReference = NONE throw new fault as "Error while dispatching SOAP messagw to the endpoint "
- Check if p_encryptFlag = Y then encrypt the data fetched from BI call
- Take assign and deocde base64 to file reference. fileReference = decodeBase64ToReference($fileReference)
- 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)
- Take assign and encode back to base64. fileReference = encodeReferenceToBase64(fileReference)
- Check if p_ESSJobName != "" or != "null" then
- Check if contains($p_essJobName,";") = true then
- Fetch required params values and call ESS job
- Fetch only values of paramters and save in a csv file(https://soalicious.blogspot.com/2021/05/oic-params.html)
- Read the csv file using stage
- Submit ess job request using erp adapter erpIntegrationService
- Monitor the ess job status
- If anything failed for monitor child integration , will throw a new fault.
- Else,
- Call the ess job without parameters and monitor thr ess job status
- Update job params:
- jobDefinition: substring-after($p_essJobName,",")
- jobPackage: substring-before($p_essJobName,",")
- Configure Oracle Cloud adpater erpIntegrationService and submitEssJobRequest operation
- Map the job definition and job package.
- Monitor the ess job.(https://soalicious.blogspot.com/2024/01/oic-erp-monitor-progress-of-ess-job-and.html)
- 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