cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping

Former Member
0 Kudos

Dear All,

I have to map the following structure:

source                                                        Target

MT_XYZ                                                    MT_ABC

Recordset                                                  Person

                                                                  abc

  Empdata1                                                 def
    abc                                                         ghi

    def                                                          jkl   

    ghi 

    jkl      

Empdata2                                               

    abc                                                          

    def                                                           

    ghi 

    jkl

   

I have to send either Empdata1 or Empdata2 to Person(Target) at a time.

Please help me for this requirement.                                                                                                                      

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Harinath,

Refer attached UDF, it is similar to your requirement.

Just change according to your input data.

Public void existsInContextEMPDATA(String[] a,String[] b,ResultList result,Container container){

for (int i = 0; i < a.length; i++) {

if (a[i].equalsIgnoreCase("abc")){

result.addValue(a[i]);

}

}

for (int i = 0; i < b.length; i++) {

if (b[i].equalsIgnoreCase("abc")){

result.addValue(b[i]);

}

}

Hope this will be helpful.

Regards,

Neelima.

iaki_vila
Active Contributor
0 Kudos

Hi Harinath,

Are 'abc' or 'def' fields or values?, it's different to have:

1.

<Empdata1>abc</Empdata1>

<Empdata1>def</Empdata1>

or to have:

2.

<Empdata1>

   <abc>one</abc>

    <def>two</abc>

</Empdata1>

I suppose that we are in the first case. You need the way to merge two source fields in one target field. Right now, i think two different way to achieve your goal, you can do:

1. An UDF which it has the Empdata1 and Empdata2 like input queues. You work with all value in the queue . You only need to write two FORs and to add the values to the output.

2. Make two mappings. The first like the show in this thread The second, you will need to collapse the contexts to have one queue like you strucure.

Regards.

Former Member
0 Kudos

Hi Inki Vila,

All are field names only.

gagandeep_batra
Active Contributor
0 Kudos

Hi Hari,


On what Condtion you have to map?

define the condition on root node & also change the occurrence of target (Person) is 1..1

Regards

gagan

Former Member
0 Kudos

Hi Gagan

if abc=R1 then We hav to send Empdata1

if abc=R2 then we have to send Empdata2

Regards,

Hari

gagandeep_batra
Active Contributor
0 Kudos

first right click on person  then add duplicate sub tree

then just put the condition on Person  for respective Employee data-

like below:

other option is you can add  all condtion in single Person node also