cancel
Showing results for 
Search instead for 
Did you mean: 

Success Factor Replication(Xslt Mappping /Standard Mapping)

foufou
Explorer
0 Kudos

Hi Expert ,

I have an issue with the employee replication from SuccessFactors as it generates two employment_information elements, including one with the inactive Org unit (Business Unit, Dep..). I've noticed that only the no longer valid one has an end_date, while the currently valid one does not .

<queryCompoundEmployeeResponse>
<CompoundEmployee>
<id>2555</id>
<person>
<person_id>5555</person_id>
<end_date>5555-12-31</end_date>
<first_name>test</first_name>
<start_date>2022-05-01</start_date>
<personal_information>
<end_date>2022-04-30</end_date>
<first_name>test</first_name>
</personal_information>
<personal_information>
<end_date>2021-02-28</end_date>
<first_name>test</first_name>
<start_date>1987-05-25</start_date>
</personal_information>
<address_information>
<end_date>5555-12-31</end_date>
<start_date>2022-05-01</start_date>
</address_information>
<employment_information>
<end_date>2022-04-30</end_date>
<start_date>2011-09-01</start_date>
<user_id>5555</user_id>
<job_information>
<business_unit>IT-000-000</business_unit>
<company>5555</company>
<department>IT-044-021</department>
<division>IT-044-000</division>
<start_date>2022-11-01</start_date>
</job_information>
<job_information>
<business_unit>IT-000-000</business_unit>
<company>5555</company>
<department>IT-044-021</department>
<division>IT-044-000</division>
<end_date>2022-10-31</end_date>
<start_date>2022-05-01</start_date>
</job_information>
<job_information>
<business_unit>IT-000-000</business_unit>
<company>5555</company>
<department>IT-044-021</department>
<division>IT-044-000</division>
<end_date>2022-04-30</end_date>
<start_date>2021-03-18</start_date>
</job_information>
<job_information>
<business_unit>IT-000-000</business_unit>
<company>5555</company>
<department>IT-044-021</department>
<division>IT-044-000</division>
<end_date>2021-03-17</end_date>
<start_date>2021-03-01</start_date>
</job_information>
</employment_information>
<employment_information>
<employment_id>5555</employment_id>
<start_date>2022-05-01</start_date>
<user_id>5555</user_id>
<job_information>
<business_unit>D66x00-000-9</business_unit>
<company>4000</company>
<department>D66F40-264-9</department>
<division>D66F40-000-9</division>
<end_date>5555-12-31</end_date>
<start_date>2032-10-01</start_date>
</job_information>
<job_information>
<business_unit>D66x00-000-9</business_unit>
<company>4000</company>
<department>D66F40-264-9</department>
<division>D66F40-000-9</division>
<end_date>2032-09-30</end_date>
<start_date>2024-01-01</start_date>
</job_information>
<job_information>
<business_unit>D66x00-000-9</business_unit>
<company>4000</company>
<department>D66F40-264-9</department>
<division>D66F40-000-9</division>
<end_date>2023-12-31</end_date>
<start_date>2023-08-04</start_date>
</job_information>
<job_information>
<business_unit>D66x00-000-9</business_unit>
<company>4000</company>
<department>D66F40-264-9</department>
<division>D66F40-000-9</division>
<end_date>2023-08-03</end_date>
<start_date>2023-06-01</start_date>
</job_information>

</employment_information>

</person>
<execution_timestamp>2024-12-06T13:15:40.000Z</execution_timestamp>
<version_id>231120</version_id>
</CompoundEmployee>
</queryCompoundEmployeeResponse>

To filter out the old one, I attempted to use a pre-mapping with graphical mapping, aiming to exclude segments with an end_date defined. Unfortunately, this approach keep also inactive employee information segments.> did not work

End_Output-: it will be replicated the employment_information with old Org. Uni (IT-*****)



I then tried to address this using the following XSLT mapping:
<xsl:template match="/queryCompoundEmployeeResponse/CompoundEmployee/person/employment_information[xs:date(end_date) lt current-date()]"/>

or:

<xsl:template match="/queryCompoundEmployeeResponse/CompoundEmployee/person/employment_information[(end_date) ]"/>


However, it didn't yield the desired outcome. How can I modify the mapping to retain only the currently valid employee information segments that do not have an end_date?

thank you in advance

MortenWittrock
Active Contributor

Hi Fathi

Something happened to your screenshots. Also, please include sample XML as text, not graphics. That way it can be easily copypasted. Use the CODE button to insert the XML to preserve formatting and special characters.

Regards,

Morten

foufou
Explorer
0 Kudos

@7a519509aed84a2c9e6f627841825b5a thanks for your notice , I updated that

View Entire Topic
MortenWittrock
Active Contributor
0 Kudos

Hi Fathi

This is very similar to your other question about mapping a SuccessFactors API response. This XSLT stylesheet will remove all employment_information elements with an end_date child element:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xsl:output method="xml" />
	<xsl:mode on-no-match="shallow-copy" />
	<xsl:template match="employment_information[end_date]"/>
</xsl:stylesheet>

Regards,

Morten

foufou
Explorer
0 Kudos

Hi Mortan ,

thank you for your proposed solutions and the effort you've put into them.

I attempted to resolve this using your provided XSLT mapping, but unfortunately, it did not work

I get the following error in anothor xslt mapping step (when I run simulation mode und track the payload ,it displays the correct data .However in "Match und Merge multimessage.." XSLT Mapping I encouter the issue)

BR

MortenWittrock
Active Contributor
0 Kudos

Hi fethi_men

The stylesheet works with the sample data you included. I tested it before posting, of couse. If some other part of your iflow fails, that really has nothing to do with this question.

Regards,

Morten