Extending SuccessFactors using Intelligent Services and SAP cloud platform
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
Go to Eclipse -> windows -> preferences -> Sever
Choose SAP Cloud Platform and provide the credentials and URL
Next right click on your project-> Run As -> Run on Server
Click on Manually Create new server and choose server as SAP-> SAP Cloud Platform. Click on Finish
Once the application is deployed in cloud platform, you should see the server as started
Now Go to your SAP cloud platform account and then to you subaccount – > Java applications
You should see the application as started. You will also find the end point URL here. Note this URL down .
This is nothing but the REST API endpoint URL which is called by Integration center upon the new hire IS event in SuccessFactors
3. Creating Integration in Integration center to call the rest API and link it to ISC (Intelligent Services Center)
The next step of the Implementation is to create an Integration via integration center
Go to Admin Center -> Integration Center -> My Integrations and click on create new and more Integration types
Select the type as Intelligent Services , Destination as REST and format as JSON as shown below
Select the event as New Hire in search entity page. The new hire event uses Job Information as the Base Entity.
In configure Fields View select the fields you want to send across to your java application in JSON Format.
Create three fields userID , name and phone. Map them to relevant Job Information fields using the mapping view.
After mapping is done , you should have something like the this:
In the response Tab, upload a dummy JSON File with the above fields
In Destination settings, You would need to maintain the rest API details
The End Point URL is constructed as below
The HCP APP URL can be fetched from your HCP account when you deployed the java application (please see section 2 )
The path /rest/json/metallica/post is the path of the rest API. /json/metallica is path to Rest API Class JSONService and /post is path to method to send SMS
Save the Integration. You are done with setting up Integration Center definition
4. Deploy the Integration in Intelligent Services Editor
This is the final step of the prototype.
Go to Business Configuration and attach the standard Intelligent Services Hire event Rule (EVENT_HIRE) since this is the publishing event rule
Go to Intelligent services editor (ISC) and select new hire event.
Create a new Flow and new flow rule as Shown below
Click on Integration Tab of Flow and Add the integration you just created from Integration Center
After adding integration, you should see the below
Click on Actions on Top and save the flow. You should see a message that your flow is published
Go To Add new employee and Hire an employee with effective start date as To Example : Jan 11th 2017 )
Jack ISC is the employee Hired in my demo with ID as 1922 and Mobile Number as “+919XXXXXXXXXX” (in contact details of hire step)
Monitoring of the event in Intelligent Services Editor :
Logs from Integration Center :
Message in Java Class (Rest API)
SMS received by new hire on his Mobile number
Good one Neelesh. Steps with screenshots made it simpler to understand..
Great blog Neelesh 🙂
Thanks Gregg 🙂
Fantastic blog. I am excited to check with my client if they would like to use this functionality. Cheers!
Thanks Viv 🙂 Let me know if you need any more info after your discussion with client
Appreciate the granular details. Thank you Neelesh.
Thanks Gajan 🙂
Very Nice Neelesh. Keep it up.
Thanks Priyanka 🙂
Really good informative blog Neelesh.
It seems the project code is no longer available 🙁
Is it anywhere else?
I have the project code with me. Can you please reach out to my email address
Very Nice Blog Neelesh!
Thanks Prajwal 🙂
Great, write up Neelesh!!
Thanks Faiza 🙂
Great work and your effort to ease developments in success factor projects like REST API.
The link for the code seems expired or unavailable.
Can you help me out getting the sample code.
I already emailed you and mentioned the same. I need it seriously.
I emailed you ..
Hi Neelesh, Really Great idea and the way you implemented is superb,
The link for sample code not working, If you don't mind could you please share sample code.
Could you please let me know your email ID?
Great blog !! In order to check the functionality end-to-end it would be great if you please share the sample project code.
Thanks & Regards,
Please let me know your email ID to send the code?
Please share to me on email@example.com
Also, I send an email to you on the mentioned id.
Thanks a lot for the help.
To try and do some R&D i need your code, The file is not available in given link.
it would be great if you please share the sample project code.
Can you share the code to firstname.lastname@example.org
Congratulations for the great blog!
Would you mind sharing the sample project code?
My e-mail address is email@example.com
Thanks for sharing this information. Very helpful.
I tried doing this however Integration center is not accepting the webservice address.
I am able to test the service from SOAPUI, but when I try to use it in Integration center, it either does not accept it saying host not found or similar such error. I tried providing the IP Address and Port directly, that does not work either.
Did you experienced similar issues when connecting from Integration center to your webservice?
Did you have to make any other server settings?
I have not faced any such issues. It works fine if you have an HTTPS URL listed correctly. It still works fine in my sales demo as of today.
Revised version and simplified code with libraries is in my new blog
Good Blog. Made it very simple to understand with screenshots.
Thank you Jeeja 🙂