Human Capital Management Blog Posts by SAP
Learn directly from SAP experts through blogs that deliver practical guidance and opportunities to deepen your expertise.
cancel
Showing results for 
Search instead for 
Did you mean: 
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
10,108
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

User Class:

The User object will have three attributes which you receive from Successfactors Intelligent Services event: userID, name, phone

JSONService class:

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

https://www.sap.com/india/developer/tutorials/hcp-java-eclipse-setup.html 

 

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

<<HCP_APP_URL>> /rest/json/metallica/post

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


5. Testing


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



 

 

 
34 Comments
PTogapur
Product and Topic Expert
Product and Topic Expert
0 Kudos
Good one Neelesh. Steps with screenshots made it simpler to understand..

 
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks Pradeep
0 Kudos
Great blog Neelesh 🙂
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks Gregg 🙂
former_member22501
Discoverer
0 Kudos
Hi Neelesh,

 

Fantastic blog. I am excited to check with my client if they would like to use this functionality. Cheers!
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks Viv 🙂 Let me know if you need any more info after your discussion with client
r_gajan
Product and Topic Expert
Product and Topic Expert
0 Kudos
Appreciate the granular details. Thank you Neelesh.
priyankaporwal
Product and Topic Expert
Product and Topic Expert
0 Kudos
Very Nice Neelesh. Keep it up.

 
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks Priyanka 🙂
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks Gajan 🙂
Former Member
Really good informative blog Neelesh.
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks Avinash
0 Kudos
Hello Neelesh,

Great job!

It seems the project code is no longer available 😞

Is it anywhere else?
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
Hi Manuel

I have the project code with me. Can you please reach out to my email address

neelesh.kamath@sap.com ?

 

Thanks

Neelesh
Prajwal
Product and Topic Expert
Product and Topic Expert
Very Nice Blog Neelesh!
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks Prajwal 🙂
FaizaAnjum
Advisor
Advisor
Great, write up Neelesh!!
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks Faiza 🙂
Former Member
0 Kudos
Hi Neelesh,

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.
Former Member
0 Kudos
I already emailed you and mentioned the same. I need it seriously.
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi krishna

I emailed you ..
Former Member
0 Kudos
Thanks Neelesh
Former Member
0 Kudos
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.
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Dharani

Could you please let me know your email ID?

Thanks
former_member23330
Discoverer
0 Kudos
Hi Neelesh,

 

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,

Subhadip

 
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi,

Please let me know your email ID to send the code?

Regards

Neelesh
former_member23330
Discoverer
0 Kudos

Hi Neelesh,

 

Please share to me on dutta.subhadip.84@gmail.com

 

Also, I send an email to you on the mentioned id.

 

Thanks a lot for the help.

 

Regards,

Subhadip

 

Former Member
0 Kudos
Hi Neelesh,

Fantastic blog.

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 saivinesh2@gmail.com

 

Regards,

Saivinesh
TT
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Neelesh,

 

Congratulations for the great blog!

Would you mind sharing the sample project code?

My e-mail address is takashi.taniguchi@sap.com

 

Thanks,

 

Takashi
LinkinP
Explorer
0 Kudos
Hi Neelesh,

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?

 
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos

HI Linkin,

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.

FYI:

NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Folks.

Revised version and simplified code with libraries is in my new blog

https://blogs.sap.com/2020/09/27/extending-successfactors-using-intelligent-services-and-sap-cloud-p...

Thanks
jeejabait
Product and Topic Expert
Product and Topic Expert
 

Hi Neelesh,

 

Good Blog. Made it very simple to understand with screenshots.

 

Thanks,

 

 

 
NeeleshKamath
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thank you Jeeja 🙂