SAP HCI: Integrate with Success Factors using OData API Query ($Select and $Expand)
Two weeks ago we(myself, Patrick Kelleher and Paul Todd) were preparing for an event and were doing a full blown integration scenario using SAP HANA Cloud Integration.
And today’s blog is just a small bit of the entire integration scenario.
I hope to write a follow up blog to share mapping aspect as well.
In simple terms, We wanted to fetch data from SuccessFactors Workflow Request Object(WfRequest) to be displayed on a UI (remember the full blown integration scenario 🙂 )
For simplicity of the blog I am assuming that the request and response is from/to SOAP UI to SuccessFactors. And we used SAP Hana Cloud Integration for integrating the both.
This is how a Sample Success Factors Workflow Request Object data looks like:
WfRequest has a nested structure, WfRequest–>empWfRequestNav–>wfConfigNav (and more)
Along with the data from WfRequest, data from wfConfig was also needed:
The Main components/systems needed are,
1. SOAP UI to trigger the request and to see the response
2. SAP HCI for integration
2. Success Factors from where the data is pulled: In my case I fetch the WFRequest Object and also use query select and expand to get data from the nested structure (via the SuccessFactors OData API call)
So, A Request is sent from SOAP UI to the HCI tenant which further sends the request to Success Factors system via a Odata API call to fetch data. This is then sent back to the SOAP UI, (SOAP UI–> SAP HCI Tenant –> Success Factors –> Response sent back to the SOAP UI which made the request)
The overall flow should look like this:
The prerequisites are:
- SOAP UI installed, which is used to send request and see the response (I downloaded from soapui.org)
- SAP HCI Tenant. User ID/Password for the Tenant should be available
- Eclipse/SAP HCI Tooling: If you are using Eclipse for creating the iFlow, like I did, then SAP HANA Cloud Integration Tool for Eclipse should be installed (SAP Development Tools for Eclipse)
- Success Factors System: Login details for the Success Factors System you want to connect to (More details can be found SuccessFactors Adapter in SAP HANA Cloud Integration (SAP HCI)
- Ensure SaaS Admin has deployed the required SuccessFactors public certificate keys in the system.jks file of the HCI Tenant that you are using to connect to the SuccessFactors (More details on Security Artifacts: SAP HCI – Security FAQ and Checklist! | SCN)
- For connection between SOAP UI and the HCI Tenant: We use Basic/Role based authentication
- In Eclipse, User Credentials Artifact providing the Credentials for Success Factors should be deployed, as shown below
- (Integrations Operations–> Deploy –> Deploy Artifacts –> User Credentials –> Enter Success Factors Login Details)
Ok, so now that the prerequisites are in place lets start with the main integration flow (iFlow) in Eclipse:
Main integration flow
I use Eclipse for creating an iFlow. You could also use Web UI for your HCI Tenant creating your iFlow.
(In Eclipse, ensure the perspectives Integration Designer and Integration Operations are open (You find them in Menu–> Window –> Open Perspective –. Other))
Step1: Create an Integration Flow(iFlow)
Open Integration Designer Perspective
Menu–>File–>New –>Integration Project
Provide a Project name (ex: SOAPUI_HCI_SuccessFactors) and press Next
Provide Integration Flow Name(IF_SOAPUI_HCI_SuccessFactors), ensure Point-to-Point Channel is selected.
This creates the basic iFlow for you
The Steps to be followed for the integration flow are as below:
Step2. Configuring SOAP Sender
Select the Sender Box and edit the Properties
Authentication Mode: Role-based Authentication
Next, Configure the sender channel (Right click on the Channel connector dotted arrow that goes from Sender box into HCI Integration Process Box)
In the General tab,
Enter Sender Channel Name: SOAP_Sender_Channel
Adapter Type: Browse and select SOAP
In the Adapter Specific tab,
Enter Address: ex: /TaskCollection (This will be used automatically for endpoint name creation which will be used from SOAP UI)
Processing Settings as Robust. A Robust will ensure that a response sent at the end of integration will be sent back to the SOAP UI)
So this completes our configuration for the SOAP Sender. Go back to the iFlow in Integration Designer/Model Configuration tab
Next Step is to configure the sending of request to Successfactors
Step3. Connection and configuration for Success Factors
Drag the ‘Service Call‘ Task into the Integration Flow in between the start and end message. This is the Request-Reply step that is used to request data from Success Factor and wait for response to come back
Now drag and drop Receiver box from the Palette, just outside the Integration Process box
Give a Name(Ex: SFSFReceiver) in the Properties tab for this Receiver box
Select a Message Flow Connector from the Palette and add this connection from Request Reply step to SFSF Receiver
Configure the channel by right click
Enter the General Tab details,
Adapter Type: SuccessFactors
Message Protocol: OData V2 (Since we make an OData API call to fetch WfRequest)
Enter the Channel Adapter Specific tab,
Address: URL for the Success Factors API system
Credential Name: SFSF_Credentials (This is the name of the credential we deployed in the Prerequisite step for Success Factors)
Content Type: Atom (This ensures the response sent back is in xml format)
For the Operations Details Field, press the Model Operation button to configure the Query,
In the popup that appears, enter the login details for the Success Factors system and proxy if needed.
Select the WfRequest Object and press Next
Select Operation: Query(Get)
Select all the necessary Fields and top is 5(selects only the first 5 records),
This will create an edmx file and also a xsd file (in my case WfRequestEntityGET0.xsd). The created xsd file can be used for mapping(can be seen in a follow up blog).
In the Operations Details field the Query should already appear
So the rest of the fields from the nested structure of WfRequest(fields from empWfRequestNav and wfConfigNav) that are not shown in the Model operations should be selected and expanded on.
In Operations Details field,
Add the following line before the &$top=5 in the $select Query. (do not forget the comma 🙂 )
The final query should look like this:
Go back to Model Configuration (iFlow)
Step4. Rest of the changes in iFlow
Next delete the Channel after the end Message and also delete the Receiver at the end.(As the SOAP Sender itself is the receiver of response)
So now we have the SOAP Sender sender triggering the integration via SAP HCI to Success Factors. Response coming back to SOAP UI (due to Robust setting of SOAP Sender channel)
Step5. Check and Deploy
We should now deploy the integration content onto the tenant. This will provide us with the Endpoint URL that should be used in SOAP UI to trigger the data flow as per integration flow.
Right click outside the Integration Process block and Execute Checks (to check for errors)
Hopefully no errors. If there are errors ensure you correct them before deploying.
Now Right click and Deploy Integration Content
Choose the Tenant on which the iFlow needs to be deployed.
Ensure that the iFlow is deployed successfully.
In Eclipse now switch to Integration Operations Tab,
This should show the tenant details in the Node Explorer view, on the left hand side
Click on the Worker Node in your Node Explorer. The Component Status View of the Node will reflect the status of deployment
To get the endpoint URL,
Node Explorer–>IFLMAP–> Right Click –> Show Properties
This should open the Properties Tab.
Choose the Services tab
This should show the Deployed Integration Project Name with the Endpoint URL.(This URL is used in SOAP UI)
Copy the Endpoint URL (by right click on the URL–>Copy Endpoint URL).
Testing from SOAP UI
Now we test this in SOAP UI (a prerequisite to be installed)
Open the SOAP UI,
1. Create a New soapUI Project using the Menu–>File New soapUI Project.
In the popup that appears Select the request wsdl file: You will find file HCI_WSDL_WfRequest.wsdl as an attachment in the blog, download it and just remove the extension .xml from the file retain the wsdl format).
This should provide the Request Payload(with empty body) that is sent from SOAP UI to SAP HCI to trigger the iFlow.
2. In the Left Hand side, Open the Request1 from HCI_WSDL_WfRequest and double click to see the Request payload
3. Also on the Left hand side, in Request Properties, enter Username and Password for SAP HCI tenant. (Remember the SOAP Channel we configured in the iFlow is Role based authentication)
4. In the Right Hand side top, Enter the Endpoint URL , and Press the Green button ( Submit request to specified Endpoint URL)
The Response should be seen on the right hand side with request data from the nested structure of WfRequest, providing data from WfRequest, empWfRequestNav, wfConfigNav
Thats it, we see the integration from SOAP UI to SuccessFactors via SAP HCI working 🙂
Mapping example in a follow up blog.
I hope this helps.