cancel
Showing results for 
Search instead for 
Did you mean: 

n:n mapping of subtrees?

Former Member
0 Kudos

Hi

I need to map a sub-tree that occurs n times on exactly the same sub-tree in another structure (also occurs n times where n1 = n2).

When I test my mapping it only creates the first sub-tree and igonres the rest. Is there anything special that I need to be aware of?

Thanks a lot,

Nana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nana,

Check if the parent node of the sub-node getting as many times as it needs to, so that it capacitates n occuerrences of the sub-node.

Please provide ur src and tgt strucctures for more clarity.

praveen

Former Member
0 Kudos

The parent node is the root node and as such has no occurens. Does that matter?

Just for illustration...

The source and target structure looks as follows:

<root>

<sub1>[occurs: 1]</sub1>

<sub2>[occurs: 0..unbound]</sub2>

<root>

Now if I map the source wit two <sub2> on the target, I only get one <sub2> structure.

Former Member
0 Kudos

Hi Nana,

The mapping you've done should give you the desired result. Can you click on 'display queue' on ur mapping functions in the design tab? You'll get more idea what is happening at runtime.

praveen

moorthy
Active Contributor
0 Kudos

HI Nana,

<i>*****Now if I map the source wit two <sub2> on the target, I only get one <sub2> structure</i>

You mean to say, you have two Sub2 structures in the Target ??? Like this

<root>

<sub1>[occurs: 1]</sub1>

<sub2>[occurs: 0..unbound]</sub2>

<sub2>[occurs: 0..unbound]</s

<sub2>

What I understood is you have source with 1 sub2 node and you need to generate multiple sub2 node based on the soure occurence. If so try with context change,SPlitBy Value concepts.

Also make sure that your target occurence of sub2 node is 0-unbounded.

Inorder to get the all the field values under sub2 node, you may need to write small user defined function stating that for each values of sub2 , generate all these values of current sub2 node,

Hope this helps.

Regards,

Moorthy

Former Member
0 Kudos

Thanks for all your help, it was all helpfull however the problem was somewhere else.

I changed the data type but I forgot to refresh the mapping so it was still using the old DT.

Thanks to all and have a nice weekend.

Answers (1)

Answers (1)

moorthy
Active Contributor
0 Kudos

Hi Nana,

Check that your subtree is occuring as many time as your parent node..

If not try with change the context of Source Subtree into Message level and check it if it generates as many as in the source.

SO your mapping will be

Source->(COntext changed to Message Level)->SplitByValue->Target

Just to get into more-

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

Just try it..

May be useful.

Regards,

Moorthy