Hello everyone
Context
We recently deployed SAP SuccessFactor within our IT services and encountered a problem with the provisioning of users who had several job_information within SAP when the HR department anticipated changes to users (transfers or manager changes for example). The direct effect was that IDN carried out the changes in our user’s identity (authoritative source) as soon as these job_information were modified, without taking into account the start_date specified by the HR department, with the consequence that rights were lost/accessed.
Objectives
- Do not process SAP data if job_information has a start_date in the future, except if all job_information are in the future (allows you to retrieve information for a user soon to join the company without waiting until D1 of his arrival).
- Recover the last job_information with a start_date in the past.
Resources
I’ve found several resources on the forum or in the documentation, but these are not complete and do not fully meet my needs:
- SAP SuccessFactors Connector Future Dated Activity Discussion (not resolved)
- Integrating SuccessFactors - Sailpoint Documentation
The latter gives examples of how to use Xpath (v2.0) to filter the results obtained by the SAP connector but which didn’t work in my environment
Testing xPath
Testing a new Xpath via xpather.com:
New Xpath and explanation :
if (count(//employment_information/job_information[xs:date(start_date) le current-date()]) eq 0) then
(//employment_information/job_information/job_title)[last()]
else (//employment_information/job_information[xs:date(start_date) le current-date()]/job_title)[1]
If there are no job_information with a start_date in the past:
- Retrieves the job_title of the most recent job_information in the future for upcoming arrivals.
Otherwise:
- Retrieves the job_title of the most recent job_information with a start_date in the past.
Use Case 1: User with job_information in the past AND in the future
-
Objective: Assuming it’s 24/04/2024, IDN should retrieve the job_information with the most recent start_date in the past, where the user James BOND is titled as “Senior Spy”.
-
Test Data:
<sfobject>
<id>007</id>
<type>CompoundEmployee</type>
<person>
<personal_information>
[*REDACTED*]
<business_first_name>James</business_first_name>
<business_last_name>BOND</business_last_name>
<start_date>2023-01-01</start_date>
</personal_information>
<employment_information>
[*REDACTED*]
<start_date>2023-01-01</start_date>
<user_id>007</user_id>
<job_information>
[*REDACTED*]
<job_title>Spy Chief Officer</job_title>
<start_date>2025-01-01</start_date>
</job_information>
<job_information>
[*REDACTED*]
<job_title>Senior Spy</job_title>
<start_date>2024-01-01</start_date>
</job_information>
<job_information>
[*REDACTED*]
<job_title>Junior Spy</job_title>
<start_date>2023-01-01</start_date>
</job_information>
</employment_information>
</person>
</sfobject>
- xpather.com screenshot:
Use Case 2: User with job_information in the past only
-
Objective: Assuming it’s 24/04/2024, IDN should retrieve the job_information with the most recent start_date in the past, where the user James BOND is “Senior Spy”.
-
Test Data:
<sfobject>
<id>007</id>
<type>CompoundEmployee</type>
<person>
<personal_information>
[*REDACTED*]
<business_first_name>James</business_first_name>
<business_last_name>BOND</business_last_name>
<start_date>2023-01-01</start_date>
</personal_information>
<employment_information>
[*REDACTED*]
<start_date>2023-01-01</start_date>
<user_id>007</user_id>
<job_information>
[*REDACTED*]
<job_title>Senior Spy</job_title>
<start_date>2024-01-01</start_date>
</job_information>
<job_information>
[*REDACTED*]
<job_title>Junior Spy</job_title>
<start_date>2023-01-01</start_date>
</job_information>
</employment_information>
</person>
</sfobject>
- xpather.com screenshot:
Use Case 3: User with job_information in the future only (upcoming arrival)
-
Objective: Assuming it’s 24/04/2024, IDN should retrieve the job_information with the closest start_date in the future, where the user James BOND is “Junior Spy”.
-
Test Data:
<sfobject>
<id>007</id>
<type>CompoundEmployee</type>
<person>
<personal_information>
[*REDACTED*]
<business_first_name>James</business_first_name>
<business_last_name>BOND</business_last_name>
<start_date>2023-01-01</start_date>
</personal_information>
<employment_information>
[*REDACTED*]
<start_date>2023-01-01</start_date>
<user_id>007</user_id>
<job_information>
[*REDACTED*]
<job_title>Senior Spy</job_title>
<start_date>2026-01-01</start_date>
</job_information>
<job_information>
[*REDACTED*]
<job_title>Junior Spy</job_title>
<start_date>2025-01-01</start_date>
</job_information>
</employment_information>
</person>
</sfobject>
- xpather.com screenshot:
Modifying the SAP Connector in IDN to Address the Problem
-
Set Up the SAP Connector:
Navigate toAdmin > Connections > Sources > SAP_SuccessFactors
in IDN. -
Edit Configuration:
Click on the “edit configuration” button. -
Access Advanced Settings:
Go to the “Advanced Settings” tab, where you’ll find “Attribute Mapping”. -
Modify the XPath:
Replace your current XPath with the following expression:if (count(//employment_information/job_information[xs:date(start_date) le current-date()]) eq 0) then (//employment_information/job_information/job_title)[last()] else (//employment_information/job_information[xs:date(start_date) le current-date()]/job_title)[1]
-
Adjusting the “job_title” Attribute:
You’ll need to adjust the"job_title"
attribute to suit your needs. Below is an example of how the connector might look after the modification:Example of post-modification connector setup: - Connector Name: SAP_SuccessFactors - Attribute: job_title - Original XPath : /person/employment_information/job_information/job_title - XPath Modified: if (count(//employment_information/job_information[xs:date(start_date) le current-date()]) eq 0) then (//employment_information/job_information/job_title)[last()] else (//employment_information/job_information[xs:date(start_date) le current-date()]/job_title)[1]
End
I hope it will be useful to others,
If you have any questions or comments, I’d be delighted to hear from you,
Have a nice day,
Thomas