Skip to Content
0

Mapping Issue: Repeating Target node based upon source value of another field

Jan 27, 2017 at 06:15 PM

38

avatar image
Former Member

Hi Experts,

we have a mapping requirement wherein the target node should be repeated as many as times based upon other source field i.e., <line_number> should be repeated based upon <identification_code> at the target side. whether the same can be achieve via standard function or do we need to create an UDF for the same. Kindly help me in this regard by providing the mapping logic.

Suppose the Source structure is

<INPUT_MESSAGE>
<LINE_NUMBER>1</LINE_NUMBER>
<LINES>
<IDENTIFICATION_CODE>ZA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>001</ACTIVITY_CODE>
<IDENTIFICATION_CODE>FA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>002</ACTIVITY_CODE>
<IDENTIFICATION_CODE>EF</IDENTIFICATION_CODE>
<ACTIVITY_CODE>003</ACTIVITY_CODE>
</LINES>
<LINE_NUMBER>2</LINE_NUMBER>
<LINES>
<IDENTIFICATION_CODE>ZA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>004</ACTIVITY_CODE>
<IDENTIFICATION_CODE>FA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>005</ACTIVITY_CODE>
</LINES>
</MESSAGE>

and the output should be the below one.


<OUTPUT_MESSAGE>
<LINES>
<LINE>
<LINE_NUMBER>1</LINE_NUMBER>
<IDENTIFICATION_CODE>ZA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>001</ACTIVITY_CODE>
</LINE>
<LINE>
<LINE_NUMBER>1</LINE_NUMBER>
<IDENTIFICATION_CODE>FA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>002</ACTIVITY_CODE>
</LINE>
<LINE>
<LINE_NUMBER>1</LINE_NUMBER>
<IDENTIFICATION_CODE>EF</IDENTIFICATION_CODE>
<ACTIVITY_CODE>003</ACTIVITY_CODE>
</LINE>
</LINES>
<LINES>
<LINE>
<LINE_NUMBER>2</LINE_NUMBER>
<IDENTIFICATION_CODE>ZA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>004</ACTIVITY_CODE>
</LINE>
<LINE>
<LINE_NUMBER>2</LINE_NUMBER>
<IDENTIFICATION_CODE>FA</IDENTIFICATION_CODE>
<ACTIVITY_CODE>005</ACTIVITY_CODE>
</LINE>
</LINES>
</OUTPUT_MESSAGE>

your help is highly appreciated

Regards

Faisal

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Evgeniy Kolmakov Jan 28, 2017 at 05:02 PM
0

Hi Abdul!

Your requirement can be easily achieved by using UseOneAsMany standard function in message mapping or using Variable.

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded