cancel
Showing results for 
Search instead for 
Did you mean: 

Graphical Mapping

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (5)

Answers (5)

SudhirT
Active Contributor
0 Kudos

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!

Former Member
0 Kudos

- map the input to value node of the target

- use createIf (to create either string or int) and

- SplitByValue to achieve the desired result

Former Member
0 Kudos

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>

Former Member
0 Kudos

Can you elaborate your target side structure ? if possible...

Former Member
0 Kudos

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

Former Member
0 Kudos

Concat your UserName password and data_type .. use substring and addcontext change each time..

I hope you are mapping UserName password and data_type to <string> ... I not sure but try this...

Former Member
0 Kudos

Hi,

According I understood, You want to put "

You have to verify the type of the value that contains the source and then assign to "string" node or "int" node. Notice that they have to be optional.

I hope It helps You.

Ivan.

Edited by: Jose Iván Reyes Arteaga on Dec 9, 2008 3:09 PM

dharamveer_gaur2
Active Contributor
0 Kudos

Hi

I think Using Graphical Mapping u can not put field value inside the Node Name