Monday, March 4, 2019

#690 Extending Oracle HCM with OIC

Here is a simple demo I created for a customer.
The use case: Process new hires from HCM in a custom app.

Ok, in order words, a simple SaaS extension app.
I decided to use Visual Builder(VB CS) here, well that's not really the whole truth - this is what the customer wanted to see.

Here's essentially what I did -

1. Created an app in VB CS. This app contained the following business object.

This business object contains the fields from the HCM Atom Feed to which I will subscribe.
I also created a couple of pages to manage the employee -

main-start displays a list of all employees.
main-edit-employee - displays an employee in edit mode.
This page also offers us the opportunity to retrieve the full employee details from HCM -


Note the GetDataFromHCM button. I use the HCM REST api to retrieve the emp data.
I will also use the REST api to update the said employee in HCM.

Here is the Service Connection I use.

The key for the GET is the personId, contained in the Atom Feed.

The GET request returns the following structure - a very long structure, which I have shortened for readability. Essentially all employee attributes are returned.

    "items": [
            "Salutation": null,
            "FirstName": "Frankie",
            "MiddleName": null,
            "LastName": "TSOAPUI_LName10031",
            "WorkEmail": "",
            "AddressLine1": null,
            "AddressLine2": null,
            "AddressLine3": null,
            "City": "Harmonstown",
            "PersonId": 300000172272525,
            "EffectiveStartDate": "2019-03-01",
            "WorkerType": "E",
            "links": [
                    "rel": "self",
                    "href": "https:/yourHCM/emps/00020000000EACED00057708000110D93BB36B8D0000004AACED00057372000D6A6176612E73716C2E4461746514FA46683F3566970200007872000E6A6176612E7574696C2E44617465686A81014B59741903000078707708000001694600040078",
                    "name": "emps",
                    "kind": "item",

The composite key is the hash value highlighted above - 002...
This key is required when updating the employee.

Now to the page that allows me to update the employee - I just display the City value here -

Note - I display the EmpID in "disabled" mode. Just to show that I have stripped off the leading url returned by the GET.

That I do as follows - thanks to my colleague David K. for the code.

My version worked, but was much more pedestrian.

I call this (Call Module Function) in the following EventChain - triggered when I click GetDateFromHCM -

As you can see, I assign the result of the function call to an application variable - var_hcmid.

The EmpID field on my screen is set to this -

2. Created an Integration that subscribes to the Atom Feed -

The HCM Adapter invoke is configured as follows -

I then leverage a connection based on the VB CS Employee Object REST API, to update the aforementioned.

That's it.

3. To Test - I simply select the Integration menu option - Submit Now.

I check the Employees - I now have 13 rows -

I run the VB app and select a new employee - I click GetDataFromHCM -

The city is Harmonstown -

I change to Howth and click Update City -

I validate via Postman -

No comments: