cancel
Showing results for 
Search instead for 
Did you mean: 

multiline mapping

Former Member
0 Kudos

Hi experts

i have a requirement of multiline item mappings from single node at two same level nodes at target.

Scenario:accordingly with my example screen shot :

I will get 3 Record(Source) nodes, where as i have will send name1 ,name2 details at Record 1 (target) and City to Record2.

So my question is...for 3  source nodes..how should i  do the mapping to get this result on target(shown below).Do i need to have write an UDF to achieve this.

Target result:

 

Name1

Name2

City

Name1

Name2

City

Name1

Name2

City

Thanks in advance.

Pooja.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

Why don't u change ur target structure? Create one Record1 node at target side and add 3 elements inside it - Name1, Name2 and City. In that case ur mapping will be quite simple.

Record1----O..Unbounded

     Name1

     Name2

     City

Having said that if you don't want to change ur structure, then u have to follow this kind of approach - it will certainly work

http://scn.sap.com/community/pi-and-soa-middleware/blog/2010/01/14/file-conversion-using-nodeception

Thanks

Amit Srivastava

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Pooja,

I thinkthe only solution is to make an UDF to acummulate the values name1 and name2 for the same target.

It isn't difficult. Check this UDF:

public void addMultiLine(String[] name1, String[] name2, ResultList result, Container container) throws StreamTransformationException{

result.addValue(name1[0]);

result.addValue(name2[0]);

}

According your cardinalities you will need enough records tag as name1 and name2 tags:

To get the name1 and name2 to the target:

Example:

Regards.