Invoking a Custom Fusion ESS Job via OIC
In this blog we will see how we can invoke an Custom Fusion ESS Job via OIC.
But before we begin there are some pre-requisites:
Data Model and BI Report Should be Created, you can you can check my blog on how to create a Data Model and BIP Report here
Custom ESS Job needs to be created in Oracle Fusion, you can you can check my blog on how to create a custom ESS Job here
Now the Actual Implementation can be divided into two Integrations
Integration A, which will invoke the Custom ESS Job
Integration B, which will fetch the Status of the Job
Let’s Start with Integration A
Step1: Create a Scheduled Integration ‘InvokeESSJob’
Step2: Add the ERPC Adapter of your target Fusion Instance where you have created the ESS Job and select the option ‘Query, Create, Update or Delete Information’
Step3: Select Browse By ‘Services’ and Select the ‘ErpIntegrationService’ and in the operation Select ‘exportBulkData’
Step4: Map the Request Fields of InvokeESSJob as below
jobName: /oracle/apps/ess/custom/subscriptions,FetchSubscriptionsESS
This will be the Job Path and Job Name concatenated and seperated by ‘,’
To Fetch these details you can my previous blog here
jobOptions: EnableEvent=Y
We have to supply this value, for fusion to trigger the event on ESS Job Completion
notificationCode: 30
‘3’ is for Email & Bell Notification and ‘0’ is to Send it in any case be success or failure
Your Integration A should look like below
Save and Activate it
Now lets start with Integration B
Step1: Create an App-Driven Integration and name it ‘ESSJobStatusCallback’
Step2: Add your ERPC Adapter as the Trigger and select the option ‘Receive Business Events raised within ERP Cloud’ and select the business event ‘ERP Integration Outbound event’
Specify a filter criteria so that the integration receives only the status of a specific ESS Job, else your integration will receive the status of all the ESS Jobs submitted in fusion
<xpathExpr xmlns:inp1='http://xmlns.oracle.com/apps/financials/commonModules/shared'>$eventPayload/inp1:ErpExportBulkDataEvent/inp1:JOBS[1]/inp1:JOBNAME={Name of Your ESS Job}</xpathExpr>
<xpathExpr xmlns:inp1='http://xmlns.oracle.com/apps/financials/commonModules/shared'>$eventPayload/inp1:ErpExportBulkDataEvent/inp1:JOBS/inp1:JOBNAME='Fetch Subscriptions'</xpathExpr>
And set Response type as ‘None’
Step3: Add the ERPC adapter again in the canvas and this time select ‘Query, Create, Update or Delete Information’ , select Browse By ‘Services’ and Select the ‘ErpIntegrationService’ and in the operation Select ‘getDocumentForDocumentId’
Step4: Map the ‘DOCUMENTID’ received from the event with ‘DocumentId’ of the getDocumentForDocumentId request
Step5: Now we will write the attachment received from the getDocumentForDocumentId call to a temproraty directory by adding a Stage File and Select the ‘Write File’ operation and configuring it as below
Step6: Specify the Structure as an opaque schema
Step7: Map the Content received from the getDocumentForDocumentId response to the opaqueElement
Step8: Add a Notification activity and Configure it as below, in attachment map the fileReference received as part of the Write Stage File Activity
Your Integration B should look like below
Save and Activate it.
Now to Test it, submit your Integration A on Ad-hoc.
Integration A was succesfully completed and Integration B received the Event with the status of the ESS Job
And We received the email with the log zip as attachment