cancel
Showing results for 
Search instead for 
Did you mean: 

Add an Item to a Context

Former Member
0 Kudos

Hi Guys,

I'm in a bit of a problem. I need to add an Item to a context during mapping. It should look like this:

<Source>

<item></item>

<item></item>

</Source>

-


MAPPING----


<Target>

<item></item>

<item></item>

<item></item>

</Target>

As you can see, I need to create an empty Item on the target MT. How can I do this with message Mapping?

Thanks!

Felipe

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use the following UDF


for(int i = 0 ; i <a.length ;i ++){
   result.addValue(a<i>);
}
//adding the extra element in the same context
result.addValue("");

Regards

Ivan

Former Member
0 Kudos

Hi Ivan, your UDF worked perfectly.

Pretty simple and useful. Thanks,

Felipe

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Andres,

If you always have this format then duplicate sub tree should work. Else jose function should work for you.

Regards,

---Satish