cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping : Set Field Name at Runtime

Former Member
0 Kudos

Hi All,

Source structure of my message is :

<recordset>

<Query></Query>----


0 to unbounded

</recordset>

Target Structure :

<SQL>

<key></key>----


0 to unbounded

</SQL>

Now my requirement is such that....if the source message has 3 Query elements then XI should generate key node in target message 3 times but with names key1,key2,key3.

I am not able to set the names of these target nodes at runtime based on the number of query elements in source message.

Can anybody please help me?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi ,

I have created the UDF with context type....but with result.addValue() it is not updating the field name.

How should I update the field name on the basis of occurence of source field?

Please help!

Former Member
0 Kudos

Shweta,

Can you please tell us exact requirement? probably we can suggest some new approach..

Arre you trying to Generate SQL query?

Nilesh

Former Member
0 Kudos

Hi,

You cannot change the source field name dynamically.

Please tell your scenario so it will be better to solve your doubt.

Regards,

Akshay.

Former Member
0 Kudos

Hi shweta,

try by using <b>Remove Contexts</b> function. between Query and key. It should work. or make a UDF type <b>context</b> take one input parameter check occurance of Query print the output by using result.addValue();

Former Member
0 Kudos

HI,,

YOu can not change the names of your "Fields".

Hi,

If you want to change Value you can do that by writing UDF.

Enter this code in UDF.

for(int i=0;i<a.length();i++)

{

result.addValue("");

}

Regards,

Akshay Jamgoankar.

    • Reward points if find useful.>

Former Member
0 Kudos

Try writing UDF for the same...

In the UDF check occurrence of Query element and correspondingly generate key elements using result.addValue( ) in the target..

Former Member
0 Kudos

hi,

changing the "name" of the field is not possible at runtime. with result.addValue u give a "value" to the particular field.

your mapping wont be successful if it does not produce xml according to the target structure.

regards,

latika.

Former Member
0 Kudos