In this Blog, I would like to talk about Integration of SuccessFactors Intelligent Services with Third Party applications like Java applications built on HCP.
We have seen so many cases where a customer would like to extend SuccessFactors functionality using apps built in SAP Cloud Platform. I will provide a similar example where we would be using events from intelligent services to achieve the same.
Common examples which we can think of:
Upon Hire event, you would like to send an SMS to the new hire that he has been hired in the system and his details are created
Upon Hire event, you would like to send the new hire details to a third party system which could create order to send Goodies/Chocolates to new hire automatically
Upon termination event, you would like to notify the System which triggers exit formalities for the employee
Basically, with this approach, you can consume any Intelligent Services event and build your custom logic in third party application.
In my example below, I would be showcasing Scenario 1) of sending an SMS to new hire on Hire event.
To simply the process, I would break this prototype example into five steps
Creating Java Application in Eclipse with required rest API
Deploying the Java Application in SAP Cloud Platform
Creating Integration in Integration center to call the rest API.
Link the Integration Definition to ISC (Intelligent Services Center)
Testing the new Hire event and custom application
1. Building the Java Rest API to be called by Intelligent services
I recommend to use the Eclipse IDE (neon) since neon already has ability to connect to SAP cloud Integration services and servers.
Create a new Maven Web Project with structure similar to below.
You will have to create two packages. Package com.sfevent has an USER object. (you can name it as you want)
The user object is nothing but a representation of JSON object which is being sent across in a Payload of Intelligent Services event.
Package com.sfevent.rest has a class which represents the REST API to be called by SF Intelligent services.
Web.xml contains the web service description and pom.xml contains all the Maven Dependencies (libraries) which are required for this application
You can find the sample project code attached here Project
The User object will have three attributes which you receive from Successfactors Intelligent Services event: userID, name, phone
The service class has the actual rest API logic to consume the intelligent services event payload and then trigger a SMS to new hire.
Please note: I am using MSG91 SMS Provider API to send SMS. You can use any SMS provider API in general
2. Deploying the Java Application in SAP Cloud Platform
Once the Java project is completed , you would need to deploy this project into your SAP cloud platform account.
You can find various blogs or videos in Google on how to deploy a java application in HCP.
However I am reiterating the steps I followed here:
The below link would help you to configure SAP cloud platform tools in eclipse