cancel
Showing results for 
Search instead for 
Did you mean: 

PI / HCI treestructure topnode based upon subnode value

former_member207428
Participant
0 Kudos

Another question as a follow up to my mapping question https://scn.sap.com/message/16586891

We are reading the SuccessFactors CompoundEmployee interface.

Let's say we have the following structure :

In the end, we wish to only return the valid CompoundEmployee records where the emplStatus is 'A', and pass that information on.

Filtering on each sublevel :

  • employment_information : currentDate is between start_date and end_date. This can be 0...n records, for the given period. An employee can be active in his home country (is one valid record), but at the same time being dispatched abroad.

    

  • job_information : currentDate is between start_date and end_date, and emplStatus is A. This can be 0...1 records. Only one job_information record can have status 'A', the other will be 'D' (dorm), 'T' (terminated) etc.

    

  • the result can look like this

          record 1 :

          employment_information

               start_date : 2015-01-01

               job_information :

                    emplStatus : D

                    end_date : 9999-12-31

                    start_date : 2015-01-01

                    company : TE_EUR

                    location : BEL_1

          record 2 :

          employment_information

               start_date : 2016-02-22

               job_information :

                    emplStatus : A

                    end_date : 9999-12-31

                    start_date : 2016-02-22

                    company : TE_EUR_NLD

                    location : NLD_1



The question :

As can be seen above, I'm filtering employment_information and job_information each on their own level (so far so good), but in the end, I like to return only the CompoundEmployee records where the emplStatus is 'A' and pass that information on.

  • Can the whole filtering be completed in one message mapping file, or do we need subsequent processing?
  • To be able to filter on CompoundEmployee, does the processing of the subnodes (employment_information and job_information) be completed first in one message mapping file, and take that result as input in a second message mapping file to process the CompoundEmployee?
  • The CompoundEmployee filter can look like this (testing on emplStatus)

    

     but unfortunately returns following error :

         Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Function formatByExample: Queues do not have the same number of values] in class com.sap.aii.mappingtool.flib7.NodeFunctions method formatByExample[[Ljava.lang.String;@3cdeb7d9, [Ljava.lang.String;@1eee4172, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@3a1efcf0, com.sap.aii.mappingtool.tf7.rt.Context@2473f14b]
com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Function formatByExample: Queues do not have the same number of values] in class com.sap.aii.mappingtool.flib7.NodeFunctions method formatByExample[[Ljava.lang.String;@3cdeb7d9, [Ljava.lang.String;@1eee4172, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@3a1efcf0, com.sap.aii.mappingtool.tf7.rt.Context@2473f14b]    


Any suggestions / help ? Sample files can be downloaded from the link to the thread at the beginning of this post.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Kevin,

You can use below mapping, empStatus context should be compoundEmployee and in the sort function select decending like below.

Regards,

Praveen.

former_member207428
Participant
0 Kudos

Hi Praveen,

apparently there was an error in the input data : the input conditions returned two nodes instead of one.

Your suggestion is correct, it's the way I implemented it.

Thanks !

Answers (0)