A SAP HANA Cloud Platform Extension of SuccessFactors Time Off requests process, integrated with calendar providers.
The focus of this example is to demonstrate the integration of SuccessFactors and calendar providers by means of an SAP HANA Cloud Platform (HCP) extension application, consuming Intelligent Services (IS) Employee Time events and working with calendar providers to react to those events.
The example provides patterns for:
- Implementation of HCP extensions for event-driven scenarios leveraging SuccesFactors Intelligent Services.
- Orchestration of multiple SAP and non-SAP services in HCP: SuccessFactors OData API and third-party calendar APIs.
- Integration of HCP HTML5 UI.
- Maven project organization and build for extension applications.
This application builds on edge Java 8 technologies (lambda expressions) and innovative programming paradigms (reactive programming).
The application source is organized for convenient insight and reuse into your own proof of concept, that is not necessarily production ready. Consider it as a learning source and fast-track prototyping basis rather than a production ready solution.
- Conventions used
- Application Scenario Highlights
- Technical components overview
- Get the Source, Build and Run locally
- Installation and setup
- Using the application
- Operations Monitoring
- Copyright and License
The following conventions are used in this documentation:
- CALENDAR - refres to provider's Calendar
The extension adds the following features to the normal SuccessFactors Time Off request process:
- Time off requests managed in SuccessFactors are automatically managed in the CALENDAR.
- Conflicting meetings for all upcoming time off are listed in a dedicated Tile in SuccessFactors Home Page and feature link to the CALENDAR's UI to reschedule.
The server-side code for the timeoff application implementing the two main use
cases for handling EmployeeTime
lifecycle events (actions) and queries for
conflicting meetings. This module largely acts as application logic controller.
The input triggering the logic is either the WebService payload for the events
raised from SuccessFactors Intelligent Services, or the end user requests from
the SAPUI5 application integrated in SuccessFactors Home Page for listing
conflicting events. Based on this input, the controlling logic resolves the
event and the handler for it and delegates further processing to it. Finally, it
wraps post-processes the response in a suitable for the requester form - for
events raised from SuccessFactors Intelligent Services this is a response
payload that will be send back from the WebService and for the UI application
this is JSON payload consumable by the SAPUI5 client code.
Implements a SOAP WebService that listens for push notifications on
EmployeeTime
events changes raised from SuccessFactors Intelligent Services. A
notification handler is invoked upon reciept of an event to process the payload
from the WebService action request and return a valid response. The handler
implementation is dynamically loaded, using Spring injection mechanism, where
Spring will be looking for any implementations of the NotificationHandler
interface and resolve them as eligible notification handlers. Theoretically, the
mechanism is generic enough to imply and be capable of orchestrating multiple
implementations, but in this application we supply a single
TimeoffNotificaitonHandler
.
Implementations of (normally domain-agnostic) routines commonly used throughout the code.
Implements the CalendarServiceProvider
interface for a Google
subscription. The implemented interface is the contract between the application
controller logic implemented in app and concrete implementations,
in this case Google GMail and Calendar. It declares the actions and queries on
which the application business logic is built.
For more information, see the documentation.
Java EE Web application module. Aggregates all dependencies and provisions the SAPUI5 client code and the Spring Boot Application class. One of the products of building this module is the WAR file comprising the server-side services and the user interfaces that should be integrated in the SuccessFactors Home Page as a custom tile. Another product of the build is the HCP HTML5 app archive that can be imported either in the WEbIDE for further development and/or deployed as an HTML5 application directly in a HANA Cloud Platform account. This deployment scenario is suitable for:
- managing/developing the UI completely decoupled from the application services
The source is available on GitHub. Use Git's functionality to clone the repository or download it as a ZIP file.
The source uses Maven. Navigate to the root folder and
invoke the command mvn clean package
. The build results can be found in the
webapp project's target directory ROOT.war
that contains both the server-side
code and the user interface and is ready to be deployed in an HCP account and
timeoff-tile-html5.zip
should you decide to decouple and manage the UI artifact
as an HTML5 application.
To run locally, install the SAP HANA Cloud Platform Tools in Eclipse and run a local
Java Web Tomcat 7 server. Then deploy the ROOT.war
in it.
- Eclipse installed with SAP HANA Cloud Platform Tools plugins.
- JDK 1.8 set as an Installed JRE in Windows > Preferences > Java > Installed JREs.
- Java Web Tomcat 7 set as a runtime environment in Windows > Preferences > Server > Runtime Environments.
- All classes must be compiled with --parameter option. Windows > Prefrerences > Java > Compiler -> Store information about method parameters (usable via reflection).
- A valid HCP extension account with trust settings set up for a corresponding SuccessFactors tenant.
- A SuccessFactors user that has an administrative access to the Admin Center and the Event Notification Subscription tool.
- The SuccessFactors and CALENDAR's user accounts are harmonized to use the same timezone and emails.
Note: Refer to the documentation of invididual modules for prerequisites requirements.
-
Login to your HCP account in the cockpit.
-
Go to Java Applications and choose Deploy Application.
-
Change the following properties in the form:
- WAR File Location: Choose Browse... and select the application war file
- Application Name: timeoff
- Runtime Name: Java Web Tomcat 7
- JVM Version: JRE8
and choose Deploy and as soon the application is deployed you can also start it.
-
Navigate to the application timeoff dashboard and click Destinations in the navigation on the left
-
Follow the same process to import the destination
sap_hcmcloud_core_odata
from the same location and set it up for your SuccessFactors tenant accordingly. Use BasicAuthentication and a dedicated system user for this destination. The applicaiton will use these to receive events from Intelligent Services and send back status responses. -
The last step is to register the SAP HANA Cloud Platform Extension Application as an authorized Assertion Consumer Service in SuccessFactors Provisioning. If you do this manually, use the following url template to fetch the metadata that features the data reqired for the setup: https://{host}.successfactors.com/idp/samlmetadata?company={company-name}.
Note: Refer to the documentation of invididual modules for setup requirements.
- Login to
https://<host>.successfactors.com
with admin user - Go to Admin Center and in the Tool Search box type Event Notification Subscription and select the search hit.
- In the Event Notification Subscription tool, select the Subscriber tab
- Click the + Add Subscriber button and type the following details in the row for edit:
- Subscriber Id: HCPSubscriber
- Name: HCP Subscriber
- Group: HCP
- Client Id: HCP
- In the Event Notification Subscription tool, select the SEB External Event tab
- Click the +Add Topic button and choose Employee Time from the select control
- Click the + Add Subscription button and type the following details in the row for edit:
-
Endpoint URL: https://timeoff{account-id}.{dc}.hana.ondemand.com/services/NotifyImplPort
Note: You can find the HCP application URL in the application dashboard in the cockpit
-
Subscriber: HCPSubscriber
-
Protocol: SOAP over HTTP/HTTPS
-
Authentication: leave as it is (defaults to No authentication)
-
- Go to Admin center (still logged in with the credentials from section B) and use the Manage Home Page tool
- Click Add Custom Tile button and follow the wizard
- Provide the following details in the wizard pages:
-
Properties wizard page:
- Name: Meetings to Reschedule
- Description: This tile shows all the conflicting meetings due to the approved time off request. It also has a link to navigate to a conflicting CALENDAR's Web UI event and reschedule or cancel it.
-
Tile wizard page:
- Title: Meetings to Reschedule
- Size: 1x1
- Icon: appointment
-
Navigation wizard page:
-
Tile Target: Popover
In the content editor click the Source button and type
-
<iframe border="0" frameborder="0" src="https://timeoff{account-id}.{dc}.hana.ondemand.com/" style="width: 622px;height:600px"></iframe>
``` > Note: Change the _src_ value to fit your own application URL details.
You can find the HCP application URL in the application dashboard in the cockpit.
- Assignments wizard page:
- Assign to section: My Info
- Finally click Finish in the wizard toolbar and Save in the Home Page Management tool.
- Navigate to the Home Page to verify the tile is available and pops up when clicked on the user Home Page.
- Create some events in CALENDAR that will conflict with the time off timeframe that you will request on the next step.
- Request a new Timeoff in SuccessFactors (use Leave of Absence type beacuse it doesn't require approval workflow and is effective immediately)
- Go to CALENDAR and verify that a new Out Of Office event coressponding to your request has been created.
- In CALENDAR, navigate to Mailbox settings and check Autoreply to verify it has been preset accordingly too.
- Go to SuccessFactors Home page and check the Meetings to Reschedule tile โ it should list the meetings that conflict with the timeoff you request. The tile refreshes the list every 10 seconds. You can create some more conflicting meetings in the Calendar and check them listed in the tile too. Click on a link in the list to go to the CALENDAR's Web UI and reschedule or cancel the selected event.
- Navigate to the CALENDAR and make sure there is an existing Out Of Office event.
- Navigate to the Time Off tool in SuccessFactors and find the coressponding Employee Time Off that can be cancelled. (To see the effect immediately seelct one that doesn't require approval workflow). Click Cancel on it.
- Navigate back the CALENDAR and verify that the Out-Of-Office event is gone.
Navigate to SuccessFactors Admin Center > Event Notifications Audit Log and filter by your subsciber id (HCPSubscriber in this setup). The list that is retrieved for you presents the events sent to this subscriber and the responses from the HCP application event handling service that was received for each. The response details will either inform for a successfull processing of the event or will present an error and some helpful insight on its context for further problem tracing.
See LICENSE