cancel
Showing results for 
Search instead for 
Did you mean: 

Message mapping

Former Member
0 Kudos

I want to map the following input structure to output structure,

<MSG1>

<Input_Rec>

<Vendor>1</Vendor>

<Invoice>

<Amt>10</Amt>

<Num>1</Num>

</Invoice>

<Invoice>

<Amt>20</Amt>

<Num>2</Num>

</Invoice>

</Input_Rec>

</MSG1>

as the following

<MSG2>

<Output_Rec>

<Vendor>1</Vendor>

<Amt>10</Amt>

<Num>1</Num>

</Output_Rec>

<Output_Rec>

<Vendor>1</Vendor>

<Amt>20</Amt>

<Num>2</Num>

</Output_Rec>

</MSG2>

Is this feasible using message mapping? or do we have to use XSLT or JAVA mapping?

Accepted Solutions (1)

Accepted Solutions (1)

former_member189354
Contributor
0 Kudos

Hi,

msg1 structure into mapping editor in source side.

Msg2 structure into destination side.

Use graphical message mapping editor.

Just test it and oberver the log file.

Regards,

Mallikarjun.M

Former Member
0 Kudos

Thanks for the reply.. In my example,Invoice can appear multiple times in input message..But that is not the case with output message. For each occurance of invoice, I need to create a new 'Output_rec' node with all the header values (vendor number in this case).. How do I achieve the desired result... If I map the invoice node to the Output rec node, it fails when it cannot create the vendor node..

Former Member
0 Kudos

Do the following:

Map invoice to output rec

Map amt to amt

Map num to num

Map vendor as follows: vendor -> removeContexts -> vendor

(removeContexts is one of the node functions)

This should produce what you want.

Hope that helps,

Suresh.

Former Member
0 Kudos

Thanks Suresh.. I have a slightly differnt requirement now, where they want invoice numbers from different tags concatenated into one..

<MSG1>

<Input_Rec>

<Vendor>1</Vendor>

<Invoice>

<Num>1</Num>

</Invoice>

<Invoice>

<Num>2</Num>

</Invoice>

</Input_Rec>

</MSG1>

as the following

<MSG2>

<Output_Rec>

<Vendor>1</Vendor>

<Num>1,2</Num>

</Output_Rec>

</MSG2>

Former Member
0 Kudos

Hi,

For this you can use Advance mapping funcation.

in which you have to use java coding.

Keep 1 input parameter to the funcation.

in the code you can loop through all the Num pass as the array and append them as you want.

dont forget to set context of the Num to Input_Rec (you can do this by left clicking onto the Num that goes as input to your custom mapping funcation in the mapping editor

Former Member
0 Kudos

Thanks Bhavik

Answers (1)

Answers (1)

Former Member
0 Kudos

Open the message mapping, there are three tab (Design, Test, Messages), open Messages tab add the messages you want. From there you know what to do.

regards

SKM