Monday, August 26, 2024

OIC HCM - How to schedule and download HCM extract and send to downstream applications using Oracle HCM Cloud Adapter

Usecase: Here , we will see how to schedule and download HCM Extract and send to downstream applications using Oracle HCM cloud adpater.

High level:

We will create 3 integrations and achieve our goal as follow:

  1. One scheduler integration: This will only be used to schedule and call 2nd common extract integration and pass Effective Date name value pairs.
  2. Common HCM extract integration: This oneway appdriven integration will do the following
    1. FlowActionService >> SubmitFlow : will extract the data to ucm
    2. getFlowTaskInstanceStaus : it will show extract status
    3. If extract SUCCEEDED, get IntegrationContentId
    4. Call main integration and pass the content id.
  3. Main Integration:
    1. GET_FILE from ucm using dDocName as content id and using GenericSoapPort wsdl service
    2. Decode the file
    3. Transformed the file to downstream specific format.
    4. Call downstream app and send the file
Integration names used:
  1. INT<Interfaceno>_<Source>To<Target>_interfacedetails_Sch_V1
  2. Common_HCM_Extract_Trigger_V1
  3. INT<Interfaceno>_<Source>To<Target>_interfacedetails_Main_v1

Detailed steps:

1st Schedule integration:

Step1: Schedule param:
  • LastRunDate : ""
  • Schedule_EffectiveDate : "YYYY-MM-DD"

Step2: Assign required variables:
  • varInterfaceName: INT332
  • var_ExtractDelayinSeconds: 60
  • var_ParameterName : 'Effective Date'
  • var_ParameterValue: ns94:format-dateTime(fn:curent-dateTime(),'[Y001]-[M01]-[D01]')

Step3: Switch and check
If $schedule_effectivedate = ns74:format-dateTime($schedule_effectivedate,'[Y001]-[M01]-[D01]') or 
$schedule_effectivedate = 'YYYY-MM-DD'

Step4: INVOKE OIC common extract integration.
and map below details:
  • Interfacename
  • Processname
  • Correlationid as instanceid
  • Extractdelayinseconds
  • Lastrundate
  • Extract params(effective date name and value)
Otherwise: Throw new fault:
Invalid date format input for effective date.

Step5: From Default fault handler, rethrow fault and from Global fault >> send the fault details to Data dog app or notification as per requirement.


Common HCM extract integration:

Step1: Rest Post trigger 
Payload:
{
"interfaceName":"",
"processName":"",
"correlationId":"",
"extractDelayInSeconds":"",
"sequenceNumber":"",
"lastRunDate":"",
"extractParameters":{
"parameter":[{"name":"","value":""}]},
"extractIntegrationName":[{"integrationName":""}]}

Step2: SubmitFlow:

Select created oracle hcm cloud adapter >> select Query. Creat, update or delete information >> select Service: FlowActionsService >> Operation: submitFlow

Map the following details:
  1. Flowname
  2. Pass the parameters (Effective Date and value)
  3. FlowInstanceName: fn:concat($var_IntegrationName,fn:current-dateTime())
  4. LagislativeDateGroup
  5. RecurringFlag: false 






Step3: take a switch and check if submitFlow result = true

Step4: Take a while loop and chek the getFlowTaskInstanceStatus till extract completed true.
var_ExtractCompleted= 'false'

Select created oracle hcm cloud adapter >> select Query, Creat, update or delete information >> select Service: FlowActionsService >> Operation: getFlowTaskInstanceStatus

And map the following:
  1. flowInstnaceName
  2. flowTaskInstanceName : flowname
  3. legislativeDataGroupName







Step5: take a switch and check getFlowTaskInstanceStatus >> result >> 'COMPLETED' Then 

Assign as below:
var_ExtractCompleted : true

Otherwise: nothing.


Step6: for each extract, repeating element: extractIntegrationName.  Check content id.

Select created oracle hcm cloud adapter >> select Query, Creat, update or delete information >> select Service: FlowActionsService >> operation: getIntegrationContentId

Pass the following:

  1. flowainstanceName
  2. flowTaskInstanceName : Flow name
  3. legislativeDataGroupName
  4. IntegrationName






Step7: take a stage and write the content id and process id

Step8: take a assign and store contentid response status.

Step9: take a switch and check if contentid status = 'SUCCEEDED'
THEN 
Take a logger and log always
Concat('Status of this content id:'ContentId,'is ', Status)

Otherwise throw new error.

Step10: read the contentid and process id using stage.

Step 11:  call the next main integration and pass below fields:

  1. interfaceName
  2. processName
  3. correlationId
  4. SequenceNumber
  5. Ucmcontent details: 
    1. content id
    2. processs id
  6. lastRundate
  7. Connectivity properties:
    1. Localintegration
      1. Code : fetched from lookup
      2. Version: fetched from lookup

Main Integration:


Step1: rest trigger

Payload:
{
"interfaceName":"",
"processName":"",
"correlationId":"",
"sequenceNumber":"",
"UCMContentDetails":[{"ContentId":"","ProcessId":""}],
"flowInstanceName":"",
"lastRunDate":""
}


Step2: Download file from ucm:








Step3: read the in segments and Write the file using stage and send to downstream apps





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...