cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping-Node Function

Former Member
0 Kudos

Dear All,

This is a problem in mapping, we are facing.

Source Structure

Item------Occurance= 1 to Unbounded (Level 1)

Garment--- Occurance=1 to 1 (Level2)

Target Structure

target_Item--- Occurance = 3 to 5 (Level1)

target_Garment--- Occurance=1 to 1 (Level2)

Source Data

<Item>

<Garment> Blazer </Garment>

</Item>

<Item>

<Garment> Blazer </Garment>

</Item>

<Item>

<Garment> Blazer </Garment>

</Item>

<Item>

<Garment> Shirt</Garment>

</Item>

<Item>

<Garment> Trouser </Garment>

</Item>

Expected Target Data

<target_Item>

<target_Garment> Blazer </ target_Garment>

</target_Item>

<target_Item>

<target_Garment> Shirt </target_Garment>

</target_Item>

<target_Item>

<target_Garment> Trouser</ target_Garment>

</target_Item>

Mapping Done:-

Item -


> target_Item

Garment -


>. Remove Context -


> Split By Value(Value Change) -


> Collapse Context -


> Split By Value(Value Change) -


> target _Garment

But we are getting the following error.

Cannot produce target element /ns0:sdntarget/target_Item[4]/target_Garment. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd

But when we see in “DISPLAY QUEUE” in the mapping Editor, every thing is showing as desired.

Can some body suggest, where we are wrong.

Regards,

Navneet

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi navneet

Just do the below mapping for the target_item

Garment -


>. Remove Context -


> Split By Value(Value Change) -


> Collapse Context -


>target _item.

**Reward points if helpful

--Sankar Choudhury

Former Member
0 Kudos

Dear Shankar,

I tried your logic, but only Blazers are coming in all 3 target nodes .

Regards,

Navneet

Former Member
0 Kudos

Hi Navneet,

Have you tried the suggestion given by me as well as the solution posted by Chirag...I think that should resolve your purpose.

Let me know if still you have any problem.

Thanks

Swarup

Former Member
0 Kudos

do the mapping

Garment -


>. Remove Context -


> Split By Value(Value Change) -


> Collapse Context -


> Split By Value(Value Change) -


> target _Garment

Former Member
0 Kudos

as chirag said this mapping should work

Garment -


>. Remove Context -


> Split By Value(Value Change) -


> Collapse Context -


>target _item.

Regards,

rk

Answers (4)

Answers (4)

Former Member
0 Kudos

thanks.

Former Member
0 Kudos

Cleary ,In second level in target ,you mentioned it as

target_Garment--- Occurance=1 to 1 (Level2)

But in the sample data you have taken more than one.

So convert to 1 to some X

and check it again.

Let me know,

*******************Reward ,if found useful

Former Member
0 Kudos

do this

item-> Remove Context -


> Split By Value(Value Change) -


> Collapse Context -


> Split By Value(Value Change) ->target_item

Regards,

Rama Krishna

former_member556603
Active Contributor
0 Kudos

Hi Navneet,

Go through this blog good blog for u r requirement..

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

Thanks,

satya Kumar

reard points if its is Helpful..

Former Member
0 Kudos

Dear Satyakumar,

I ve alredy followed that Blog, and other ones before doing this mapping. Could you pls suggest, what wrong in the mapping I ve done.

Regards,

Navneet

Former Member
0 Kudos

Hi,

Target_Garment have occurance 1 and as per the node functions it will be trying to create the Queue list which is not possible.

If you change the occurance to 1..unbounded then your scenario will work perfect.

Thanks

Swarup

Former Member
0 Kudos

Hi,

As correctly said by Swarup change the occurrence.

What u did wrong is:

Item -


> target_Item -this mapping is not correct as from source u r getting four item hence the target_item will be generated 4 times.

Garment -


>. Remove Context -


> Split By Value(Value Change) -


> Collapse Context -


> Split By Value(Value Change) -


> target _Garment - this will generate only 3 times based on ur logic.

because of this u r getting error target_item[4].

use the below logic:

item-target_item

garment->splitbyvalue(value change)->collapse context-> target_item.

garment-target_garment

garment->splitbyvalue(value change)->collapse context->splitbyvalue(eachvalue)->target-garment.

chirag

Edited by: Chirag Gohil on Apr 18, 2008 5:34 PM

Former Member
0 Kudos

Dear Chirag,

Your solution almost resulted in the solution.

What I did is

garment->remove context->splitbyvalue(value change)->collapse context-> target_item.

(Added remove context after garment).

Can you pls explain, without using remove context, will it work? I am asking because, it is similar to some of the blogs.

Pls clarify.

Thanx a ton. Bravo,

Navneet