cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue

Former Member
0 Kudos

Hi guys!

I have following source msg

....

<tag1>

<action>A1</action> --is attribute

<val>xxxx</val> --is attribute

</tag1>

<tag1>

<action>A2</action>

<val>yyyyy</val>

</tag1>

I need to map to target field value of val, but from the tag1, where value of action is A2. Remember pls, that the order of tag1 can be different, so one time can be tag1 with action=A2 on the 1st place, another time on 2nd.

How to achieve it?

Thanx a lot guys, points are 4 sure 4 u

Olian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Olian

try this out

check with ifWithoutElse function

if action = A2 then transfer value from val to val

action = A2(check with ifWithoutElse graphical function)

this condition will be first input to ifWithoutElse function

pass val to ifWithoutElse function as second parameter. and then map output of ifWithoutElse to the target field

Hope this helps

Answers (3)

Answers (3)

justin_santhanam
Active Contributor
0 Kudos

Olian,

As friends suggested above. It will work perfectly.

Please follow the below URL to find the same.(Note: Please consider my reply as last, coz already Mugdha, Varun has suggested the same).

I'm giving this juz for reference.

Structure

http://www.flickr.com/photo_zoom.gne?id=653508576&size=o

Results

http://www.flickr.com/photo_zoom.gne?id=653750648&size=o

Best regards,

raj.

Former Member
0 Kudos

thanx a lot guys!

Ol.

former_member192892
Active Contributor
0 Kudos

Bring down action and val tags in 2 your mapping editor. Use the SF equals of string type to check for A1. use an if witout else boolean function and assign the value of val to the then node...

It should work

Former Member
0 Kudos

Hi;

Write a UDF for the same.

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

{

if(action<i>.equals("A2"))

result.addValue(val<i>);

}

Input to this function will be action and length

Mapping

action---- Remove Context -


UDF -


target

val -


Remove Context -


Mudit