Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 28, 2017 at 05:02 PM

    Hi Abdul!

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

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded