cancel
Showing results for 
Search instead for 
Did you mean: 

mapping problem

Former Member
0 Kudos

I have Message A and B. The structure is as below

Message A:

|--option 0..unbound

|----item 2..2

|------comments string 1..1

Message B:

|--header 0..unbound

|----text string 1..1

now i just want to map

option->header

(the second item's)comments->text

because the occurrence "item" in message A is 2, i just want to get the "comments" of second item.

the input:

<option>

<item>

<comments>1</comments>

</item>

<item>

<comments>2</comments>

</item>

</option>

<option>

<item>

<comments>3</comments>

</item>

<item>

<comments>4</comments>

</item>

</option>

the out put i want is:

<header>

<text>2</text>

</header>

<header>

<text>4</text>

</header>

How should i do?

Thank you for your reply

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rensheng luo ,

Please try the following,

Option-->Header

Coments(with context as option)-->index-\

............................................................|StringEquals-->|if_\

-


Constanat(2)./

-


|........|-->text

-


>Coments(with context as option)|then/

REgards,

KNS Kumar.

Answers (5)

Answers (5)

STALANKI
Active Contributor
0 Kudos

/people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13

Use the above links to master message mapping.

Former Member
0 Kudos

Hi,

u can write a user defined function where

first u get the number of occurance of ITEM node,

then run a for loop with index starting with 2 and increment it with 2(for i=2,i<=length of number of item node;i+2)

so u can get every second occurance of item and map it with the target.

regards

jithesh

Former Member
0 Kudos

thank you all

i have use KNS Kumar's advice,it's very useful

Thanks again

Former Member
0 Kudos

Hi Rensheng,

This can be done by writing a user defined function while doing your graphical mapping.So there you can write the logic to input the comments and return only the second comments value to the target.

Regards,

abhy

Former Member
0 Kudos

I think u can use count(node function) to know the occurance of item, and map comment -text with if count=2 to take second occurance.

Hope this solve ur problem