Background
Oracle Integration provides native connectivity to Oracle and non-Oracle Software as a Service (SaaS) and On-premises applications, such as Oracle ERP Cloud, Oracle Service Cloud, HCM Cloud, Salesforce, Workday, EBS, SAP, NetSuite and so on. Oracle Integration adapters simplify connectivity by handling the underlying complexities of connecting to applications using industry-wide best practices. To connect to a system, you just need to create a connection that requires minimal connectivity information.
Use Case
This use case explores how to use of Oracle Integration with Oracle HCM REST and ATOM services to provide information to an identity management system hosted by a customer.
The following diagram shows the interaction between the systems involved in this use case:
Before You Begin
Some steps in this tutorial have a icon next to them. Click this icon to copy the snippet of text to your clipboard and then paste where needed.
Your instructor will provide you the information you need to access the environments used in this lab.
For this lab we will provide you the following:
- Oracle Integration
- HCM Cloud
- FTP Server
Get Your Oracle Integration (OIC) Environment
Select your OIC Environment and enter your User Number to get the information needed to access Oracle Integration.
- OIC URL:
- OIC User Name:
- OIC Password: Your password will be provided by the instructor.
Get Your HCM Cloud Environment
Select your HCM Cloud Payables environment to get the information needed to access Oracle HCM Cloud.
- HCM Cloud URL:
-
HCM Cloud User Name:
- HCM Cloud Password: Your password will be provided by the instructor.
Get Your FTP Environment
Select your FTP Environment to get the information to access the FTP server:
-
FTP Server:
-
FTP Port:
-
Protocol:
-
FTP User Name:
- FTP Password: Your password will be provided by the instructor.
Sign In
-
Open your Oracle Integration instance.
Enter your user name and password.
Click Sign In.
The Home page appears.
You are now logged in and ready to use Oracle Integration.
Create the Integration
- On the Home page, click Integrations, and then click Integrations.
- On the Integrations page, click Create.
- In the Select Integration Style dialog, select Scheduled Orchestration.
- Click Select.
- In the Create New Integration dialog, configure the integration:
What do you want to call your integration?
Enter
Directory Synchronization
-
In the What does this integration do? field, enter:
This integration shows you how to use the HCM Cloud adapter with the REST adapter to generate a file for Identity Management.
- Click Create.
Configure the Schedule Action
Configure the schedule action to get the last time the integration polled the ATOM service. This avoids pulling duplicate records from the ATOM feed.
- Select the Schedule action.
- Click .
Click .
A new row appears.
- Click the Parameter Name column and change the name to
ATOMLastRunDateTime
. - Click the Description column and enter
Last successful processed ATOM pull.
In the Value column, enter
--01T00:00:00.000Z
.This sets the initial date to get the data from the HCM ATOM feed for the last six months.
- Click Close.
- Click Save.
Schedule the Next ATOM Polling
Schedule the current ATOM polling to the current date and time. The next time the integration runs, this will be the ATOMLastRunDateTime variable.
-
Click and from the Data section, drag Assign to the Integration canvas, and place it after the Schedule activity.
The Create Action dialog appears.
- In the Name field, enter
assignCurrentTimeStamp
. Click Create.
The Assign page appears.
- Click .
- Click the Variable column and change the name to
ts
. In the Value column, click .
The Expression Builder appears.
- In the Expression field, enter
concat(substring-before(/nssrcmpr:schedule/nssrcmpr:startTime,"."),".000Z")
. Click Validate.
A message confirming the expression is valid appears.
- Click Close.
Click Validate.
A message confirming the action is valid appears.
- Click Close.
- Click Save.
Access the HCM Cloud ATOM Feed
Let's use the HCM Cloud adapter to access the HCM Cloud ATOM feed.
- Hover over the outgoing arrow for the assignCurrentTimeStamp activity and click .
- In the Search field, type
HCM Cloud
. - Select HCM Cloud.
- In the Basic Info page, name the endpoint:
getNewHireATOMFeed
. - Click Next.
- In the Actions page, select Subscribe to Updates (via ATOM Feed).
- Click Next.
- On the Operations page, from the Select an ATOM Feed list, select Employee New Hire.
From the Max entries to process list, select 250.
This ensures that most customers have all their new hires appear in the ATOM Feed response.
Click Next.
A summary of the properties you configured appears.
- Review the summary and click Done.
- Click Save.
Define the Data Mapping
A Map action named Map to getNewHireATOMFeed is automatically created. We'll define this data mapping.
- Select the Map to getNewHireATOMFeed action.
Click .
The Data Mapping page appears.
- In the Target section, expand ApplicationPullParameter.
Map the $ATOMLastRunDateTime field in the Sources section, to the updated-min field in the Target section.
To map an element, select the element from the Sources section, then while clicking your mouse move it towards the target element. When you reach the target element the line turns green and a check mark appears.
Click Validate.
A message confirming the mapping is valid appears.
- Click Close.
- Click Save.
Count the New Hires
The ATOM feed doesn't return the total number of new hires, so we'll configure an assign action to calculate the number of new hires.
-
Click and from the Data section, drag Assign to the Integration canvas and place it after the getNewHireATOMFeed activity.
The Create Action dialog appears.
- In the Name field, enter
countOfNewHires
. Click Create.
The Assign page appears.
- Click .
- Click the Variable column and change the name to
countOfNewHires_assignment_1
. In the Value column, click .
The Expression Builder appears.
- In the Component section, expand Functions, and then expand Node-set.
- Drag the Count to the Expression field.
- In the Source section, locate the element EmployeeNewHireFeed_Update located under employeeNewHireFeedResponse, that is in turn located under $getNewHireATOMFeed.
Select the nodeSet parameter in the expression.
Drag the EmployeeNewHireFeed_Update function to the Count function in the Expression field.
Click Validate.
A message confirming the expression is valid appears.
- Click Close.
Click Validate.
A message confirming the action is valid appears.
- Click Close.
- Click Save.
Check for New Records
Let's check if the ATOM feed returned new records, and define what to do next.
-
Click and from the Collection section, drag Switch to the Integration canvas and place it after the countOfNewHires activity.
Two flow branches appear in the flow:
- Undefined: this branch checks the countOfNewHires. If the expression evaluates to true, the instance follows the flow in this branch.
- Otherwise: the instance follows this branch when the routing expression for the initial branch resolves to false.
Define the IF conditional flow
- Select Undefined.
Click .
The Expression Builder appears.
Define an expression to check if the ATOM feed contains any new hires:
- In the Expression Name field, enter
no new hires
. - In the Source section, select $countofNewHires_assignment_1.
Click .
The $countofNewHires_assignment_1 variable appears in the first part of the expression, and a green check mark appears next to the variable.
- In the New Condition box, enter
0.0
in the field after the equal operator. Click Validate.
A message confirming the expression is valid appears.
- Click Close.
- In the Expression Name field, enter
- Click Save.
-
Click and from the End section, drag Stop to the Integration canvas and place it after the IF no new hires condition.
This lets the integration complete if there aren't any new hires.
Define the Otherwise Flow
-
Click and from the Data section, drag Assign to the Integration canvas and place it after the Otherwise activity.
The Create Action dialog appears.
This assign activity creates a temporary variable to store the file reference of a stage file activity.
- In the Name field, enter
StageFileRef
. - Click Create.
- Click .
Click in the Value column, and enter
""
in the Expression field.Click Validate.
A message confirming the expression is valid appears.
- Click Close.
Click Validate.
A message confirming the action is valid appears.
- Click Close.
- Click Save.
Process the Records
Let's iterate over the new hires that you got from the ATOM feed in a JSON file, and retrieve the record for each new hire using the HCM Cloud REST service.
-
Click and from the Collection section, drag For Each to the Integration canvas and place it after the StageFileRef activity.
The Create Action dialog appears.
- In the Name field, enter
ForEachEntry
. Select the EmployeeNewHireFeed_Update element located under EmployeeNewHireFeedResponse, that is in turn located under $getNewHireATOMFeed.
The EmployeeNewHireFeed_Update represents an individual new hire in the JSON ATOM feed result.
Click .
The EmployeeNewHireFeed_Update element appears in the Repeating Element field.
- In the Current Element Name field, enter
CurEntry
. - Click Create.
- Click Save.
Write New Records to Stage
Let's write each new record to a stage file.
Download the newEmployeeFile.csv file.
-
Click and from the Data section, drag Stage File to the Integration canvas and place it after the For Each activity.
The Configure Stage File Action dialog appears.
- Name your action:
WriteRecordToStage
. - Click Next.
On the Configure Operation page, enter the following values:
- From the Choose Stage File Operation list, select Write File.
- Click next to the Specify the Name field.
In the Expression field enter
"newCandidateRecord.csv"
.This will be the name of the temporary file that Oracle Integration writes to stage.
- Click Save, and then click OK.
- Click Exit Expression Builder.
- Click next to the Specify the Output Directory field.
- In the Expression field enter
"/tmp"
. - Click Save, and then click OK.
- Click Exit Expression Builder.
- Select Append to Existing File.
- Click Next.
- On the Schema Options page, click Next.
On the Format Definition page, enter the following values:
- Click the Choose File/Browse.
Navigate to the location where you stored the
newEmployeeFile
you downloaded earlier and select it.A table with the structure of the
csv
file appears.- In the Record Name field, enter
User
. - In the Recordset Name field, enter
NewUser
.
Click Next.
A summary of the properties you configured appears.
- Review the summary and click Done.
- Click Save.
Define the Data Mapping
A Map action named Map to WriteRecordToStage is automatically created. We'll define this data mapping.
- Select the Map to WriteRecordToStage action.
Click .
The Data Mapping page appears.
- In the Sources section, expand CurEntry, then EmployeeNewHireFeed_Update, and then EmployeeNewHireFeed_Context.
- In the Target section, expand NewUser, and then User.
Map the following fields in the Sources section to the fields with the same name in the Target section:
- PrimaryPhoneNumber
- PersonId
- PersonName
- EffectiveStartDate
- EffectiveDate
- WorkerType
- PeriodType
- PersonNumber
- WorkEmail
To map an element, select the element from the Sources section, then while clicking your mouse move it towards the target element. When you reach the target element the line turns green and a check mark appears.
Click Validate.
A message confirming the mapping is valid appears.
- Click Close.
- Click Save.
Assign the File Reference
-
Click and from the Data section, drag Assign to the Integration canvas and place it after the writeRecordToStage activity.
The Create Action dialog appears.
- In the Name field, enter
assignStageFileRef
. Click Create.
The Assign page appears.
- Click .
- From the Variable column select $StageFileRef_assignment_1.
In the Value column, click .
The Expression Builder appears.
- In the Source section, locate the element WriteResponse located under WriteResponse, that in turn is located under $WriteRecordToStage.
- Expand WriterResponse, then expand ICSFile, and click Load more.
- Select FileReference.
- Click .
Click Validate.
A message confirming the expression is valid appears.
- Click Close.
Click Validate.
A message confirming the action is valid appears.
- Click Close.
- Click Save.
Upload the File to the FTP Server
Let's use the FTP adapter to upload the stage file to the FTP server. The FTP server represents the customer's system.
Using an FTP Client of your choice, log in to the FTP server.
-
FTP Server:
-
FTP Port:
-
Protocol:
-
FTP User Name:
- FTP Password: Your password will be provided by the instructor.
-
FTP Server:
-
If the following directory doesn't exist in the FTP server, create it:
/upload/public_ftp//out
- Go back to Oracle Integration.
Hover over the outgoing arrow after the for loop and click .
- In the Search field, type
FTP File
. Select FTP File Server.
- Name your endpoint:
WriteStageFileToFTP
- Click Next.
On the Operations page, enter the following values:
- From the Select Operation list, select Write File.
- From the Select a Transfer Mode group, select ASCII.
In the Output Directory field, enter:
/upload/public_ftp//out
In the File Name Pattern field, enter
newCandidateRecord%yyyyMMddHHmmss%.csv
.This pattern will append the year, month, date, and time to the prefix
newCandidateRecord
. For example, if you wrote the file on April 18th 2018 at 08:21:00 A.M., the file name would benewCandidateRecord20180418082100.csv
- Click Next.
- On the Schema page, from the Do you want to specify the structure for the contents of the file? group, select No.
- Click Next.
Click Next.
A summary of the properties you configured appears.
- Review the summary and click Done.
- Click Save.
Define the Data Mapping
A Map action named Map to WriteStageFileToFTP is automatically created. We'll define this data mapping.
- Select the Map to WriteStageFileToFTP action.
Click .
The Data Mapping page appears.
- In the Target section, expand ICSFile.
- Map the $StageFileRef_assignment_1 field in the Sources section, to the FileReference field in the Target section.
Click Validate.
A message confirming the mapping is valid appears.
- Click Close.
- Click Save.
Save the Last Run Date
The last step in the integration is to store the date and time you polled the ATOM feed. The next time this integration runs, it will use this date and time to avoid retrieving duplicated results.
-
Click and from the Data section, drag Assign to the Integration canvas and place it after the end of the Switch activity, before the Stop activity.
The Create Action dialog appears.
- In the Name field, enter
assignATOMLRD
. Click Create.
The Assign page appears.
- Click .
- From the list in the Variable column, select ATOMLastRunDateTime (Schedule Parameter).
In the Value column, click .
The Expression Builder appears.
- In the Source section, scroll down and select
$ts
- Click .
Click Validate.
A message confirming the expression is valid appears.
- Click Close.
Click Validate.
A message confirming the action is valid appears.
- Click Close.
- Click Save.
Define the Tracking Fields
Let's configure a business identifier that will identify the integration in reports and monitoring.
On the Integration canvas, click , and then select Tracking.
The Business Identifiers for Tracking dialog appears.
- From the Source section, select startTime, and then click .
- Click Save.
- On the Integration canvas, click Save, and then click Close.
Activate the Integration
-
On the Integrations page, locate your integration and hover over it.
The name of your integration is
Directory Synchronization
.When you hover over the integration, a set of actions appear in the Status column.
- Click .
-
Select Enable Tracing, and then select Include Payload.
Typically these options are disabled in production environments, but we'll enable them for the purpose of this lab.
-
Click Activate.
The activation will complete in a few seconds. If the activation succeeds, a confirmation message appears at the top of the page, and the status will change to ● Active.
Run the Integration
After the status changes to active, click .
- Click Submit Now.
In the Submit Now dialog, click Submit Now.
Click Submit.
A confirmation message with a request ID appears.
Click the request ID link in the confirmation message
The Track Runs page appears.
Click the Run ID link.
The Track Instances page with the tracking summary for the integration appears.
Click the start Time link.
This is the tracking field you configured earlier.
The flow for your instance appears. The flow is colored in green to indicate that it ran successfully.
- Click Close.
- In the Navigation Menu, click , then click Integrations, and then click Integrations.
- Locate your integration and click .
Click Submit Now.
The Schedule Parameters page appears.
Notice that the Current Value is updated with the date that you last ran the integration.
- Click Submit.
Verify the File Was Uploaded to the FTP
Using an FTP Client of your choice, log in to the FTP server.
-
FTP Server:
-
FTP Port:
-
Protocol:
-
FTP User Name:
- FTP Password: Your password will be provided by the instructor.
-
FTP Server:
- Browse to your directory:
/upload/public_ftp//out
Verify that the file was uploaded to your directory.
Congratulations! You just created a integration that retrieves data from an ATOM feed, transforms it, and uploads it to an FTP server for an identity management system to use it.