on 12-09-2008 1:12 PM
Hi,
Source Message Type
username "joeuser"
password "Joe123"
data_type "ready_orders"
test_mode "0"
Target Message Type
<params>
<param>
<value><string>joeuser</string></value>
</param>
<param>
<value><string>Joe123</string></value>
</param>
<param>
<value><string>ready_orders</string></value>
</param>
<param>
<value><int>0</int></value>
</param>
</params>
The param is 1 - unbound.I have to put values of fields username,password,data_type,test_mode in field string/int under node value of Target Message Type.
Please let me know how can i do this using Graphical Mapping.
Thanks.
Rushikesh
Hello Rushi,
You can try this code it is for three source fields. You can change accordingly for 4 source fields.
Take all 4 source field as input to this UDF and change the contexts as well. Manage the 0 in a[0], b[0]by any variable for multiple queues.
int j = a.length + b.length + c.length ;
for(int i=1;i<a.length+j;i++)
{
if(j%i == 0 && i != 3)
{result.addValue("<String>"+a[0]+"</String>");
result.addContextChange();
}
else if(j%i == 1)
{result.addValue("<String>"+b[0]+"</String>");
result.addContextChange();
}
else if(j%i == 0 )
{result.addValue("<String>"+c[0]+"</String>");
result.addContextChange();
}
}
Hope this works.
thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
- map the input to value node of the target
- use createIf (to create either string or int) and
- SplitByValue to achieve the desired result
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As i understand, the target structure is:
<params>
<param>
<value>
copy the param node 4 times with the mapping tool (right mouse click).
Then make for each field mapping a concat with constant <string>FIELD_1<string>..
<int>Field_4<int>.
To ensure that you can hanlde multiple input rows you have to use <params> also 1...unbounded.
<params>
<param>
<value><string>username
<param>
<value><string>password
<param>
<value><string>data_type
<param>
<value><int>test_mode
<params>
<params>
<param>
<value><string>username2
<param>
<value><string>password2
<param>
<value><string>data_type2
<param>
<value><int>test_mode2
<params>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you elaborate your target side structure ? if possible...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Target Message Type is as following
methodcall Element 1-1
->params Element 1-1
->
param Element 1-unbound
->
value Element 1-1
->
string Element 1-1
int Element 1-1
data should look like should look like
<param>
<value><string>joeuser</string></value>
</param>
<param>
<value><string>Joe123</string></value>
</param>
<param>
<value><string>ready_orders</string></value>
</param>
<param>
<value><int>0</int></value>
</param>
Thanks.
Rushikesh
Hi
I think Using Graphical Mapping u can not put field value inside the Node Name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.