Skip to content

Latest commit

 

History

History
 
 

06-ConfigureEventsOnSAPSuccessFactors

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Configure events on SAP SuccessFactors

To publish events to the SAP Event Mesh, you will have to setup the SuccessFactors system.

Setting Outbound OAuth Configuration

In this step, login to the SAP SuccessFactors instance as an administrator and register an Outbound OAuth configuration in SAP Successfactors Security Center.

  1. Go to Admin Center  > Security Center or search for Security Center in the search bar. Click on OAuth Configurations

Security Center

  1. Click Add.

  2. Fill in the required fields - Configuration Name, Token URL, Token Method, OAuth Type, Grant Type, Client ID, Client Secret. The Client ID, Client Secret, Token URL details are taken from the service key of the event mesh service instance that you need to create in SAP BTP cockpit (see the steps 4 and 5)

  3. Create a service key for the Event Mesh instance to use when you integrate with SAP SuccessFactors. No paramters are required.

Create Event Mesh service key

  1. Note down the clientid, clientsecret, and tokenendpoint values from the service key to use later.

Note Event Mesh details

  1. Add Custom Header Parameters  > Add New Row with Key = x-qos and Value = 1 and click Save to complete the process.

OAuth Configuration

Creating Outbound REST Destination

  1. Click Destination Settings from the same Security Center screen to configure a REST destination for use in the Integration Center

  2. Click Add and give the destination a name. Change the Type to REST.

  3. Enter the Endpoint URL for your Event Mesh namespace and topic that you configured in Step 3

    Destination configuration

  4. Click Save to finish the destination config

Defining Integration Center Jobs

You can create an integration from a starting entity and add data from other entities by navigating via data model relationships to fields in related entities. The following steps describe how to create a new integration from a starting entity. The outbound integration specifies the endpoint to which a message should be sent along with the content of the message.

  1. Go to Admin Center > Integration Center or search for Integration Center in the search bar.

  2. Click on My Integrations to create a new integration

  3. Click Create > More Integration Types

  4. Select the Trigger Type, Source Type, Destination Type, and Format as below and click Create

    • Select Trigger Type: Intelligent Services
    • Select Destination Type: REST
    • Select Source Type: SuccessFactors
    • Select Format: JSON

Integration Type

  1. Select the event you want to associate the integration job with. These steps will cover the Employee Hire event, but you should repeat the steps for the Employee Rehire and Employment Termination events to fully test the extension.

You can now add the remaining items as Child elements, as below:

Integration Event

  1. Provide a name for the integration and click Next

  2. In the Configure Fields tab Click the + button > Insert Sibling Elements > Set the label to data. This is the container object that they payload will be nested under. The SAP Event Mesh expects the payload to be present inside an object called data.

    Add the remaining items as Child Elements, as in the image below.

Integration Elements

  1. Select User ID under the Entity Tree View. Click Change Association to "User ID"

Integration Entity

  1. Set the Label to userId and description, as desired.

  2. Repeat steps 7-8 for the labels originalStartDate, status, hireDate, and terminationDate and see below for the mappings to source entities.

Field Label SF Entity Association Data Type
userId Job Information (EmpJob) userId Edm.String
originalStartDate Employment Details (EmpEmployment) employmentNav/originalStartDate Edm.DateTime
status Job Information (EmpJob) eventReason Edm.String
hireDate Job Information (EmpJob) startDate Edm.DateTime
terminationDate Employment Details (EmpEmployment) employmentNav/endDate Edm.DateTime
  1. On the Destination Settings tab, select REST Server Settings from Security Center and select the BTP_SENIORITY_CALC destination you created previously. Click Next.

Integration Destination Settings

  1. Review the summary, save the integration job, and then click Go to Intelligent Service Center to complete the mapping of the integration flow to an intelligent event. You can also use the Run Now button to confirm that the job ran as expected. Keep in mind this will push a message into your Event Mesh queue and may result in a new record in the persistence.

Integration Summary

Configuring flows for Intelligent Service Events

  1. Select + New Flow from the Employee Hire event. Give the flow a name, such as Seniority Flow

  2. Select Integration under Custom Activities on the right

  3. Select Hire Event REST Output > Add Integration

Integration Flow

  1. By default, the integration flow will be put under On Effective Date. Update this to When event is published

Event Timing

NOTE: don't forget to save the flow before repeating the above process for the rehire and employment termination events

Save Flow