cancel
Showing results for 
Search instead for 
Did you mean: 

Node Functions

Former Member
0 Kudos

Hi All,

i am trying to do the following mapping.

Source:

X Y

111 0010

111 0020

111 0030

222 0040

222 0050

target should be

111

|____0010

|____0020

|____0030

222

|____0040

|____0050

i am doing X -- Split by Value(value change) -- collapse context --- target field (header record)

and for Y -- Split by Value(value change) -- target field (item record)

the context change is happening properly ( i am getting the above structure), however the values are not coming correctly.

i am getting

111

|____0010

|____0020

|____0030

111 (should be 222)

|____0040 (item details are correct)

|____0050 (item details are correct)

i have done context change to <root>

any inputs ???

Regards,

Tarun Bafna

Accepted Solutions (1)

Accepted Solutions (1)

former_member187339
Active Contributor
0 Kudos

Hi Tarun,

try this

X -- Split by Value(value change) -- collapse context --- target field (header record)

Y -- RemoveContext -


> formatbyexample-- target field (item record)

X -- Split by Value(value change) --

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

what i did:

kept the header mapping as such and changed the item mapping including the format by example function together with header input.

but there is no change and i get same output

any other trick ??

Regards,

Tarun Bafna

Edited by: Tarun Bafna on Oct 26, 2009 1:28 PM

former_member187339
Active Contributor
0 Kudos

Hi Tarun,

can you provide the min and max occurrence of source and target fields, along with their XML structure (an example will do)

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Source

1 : 1

<root>

<record>

<X>

<Y>

<zzzz>

</record>

</root>

target is IDOC

<IDOC>

<EDI_DC40>

<X> 1: 100

|__<Y> (item) 0: 100000

Regards,

Tarun Bafna

former_member187339
Active Contributor
0 Kudos

Hi Tarun,

Source is like this

<root> 1..1

<record> 1..unbounded

-<X> 1..1

-<Y>1..1

-<zzzz>1..1

</record>

</root>

target is IDOC

<IDOC>

<EDI_DC40>

<X> 1..100

-fielda

-<Y> 0: 100000

right?

map like this then

X --> splitbyvalue (value change) -->collapsecontext --> <X>

X --> splitbyvalue (value change) -->collapsecontext -->splitbyValue (each value)-> fielda

Y > removecontext


>formatbyexample><Y>

X --> splitbyvalue (value change)

Node X shoudl have field (say fielda) and <Y>

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Still the same.

if i have just one line item in header,

111 0010

222 0020

333 0030

then the details are updating as desired. but when multiple line items or say multiple occurrence of same header record then problem arises

111 0010

111 0020

222 0030

Regards,

Tarun Bafna

Edited by: Tarun Bafna on Oct 26, 2009 2:23 PM

Former Member
0 Kudos

I defined following structure and it works fine. Please check and confirm.

Source Structure:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:Source xmlns:ns0="http://aa.unilever.com/SC/XProc/InbLog/TrnsMgt">

<Record>

<X>111</X>

<Y>0010</Y>

</Record>

<Record>

<X>111</X>

<Y>0020</Y>

</Record>

<Record>

<X>222</X>

<Y>0030</Y>

</Record>

</ns0:Source>

Target Structure After mapping execution:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:Target xmlns:ns0="http://Sample">

<Header>

<T1>111</T1>

<Item>

<I1>0010</I1>

<I1>0020</I1>

</Item>

</Header>

<Header>

<T1>222</T1>

<Item>

<I1>0030</I1>

</Item>

</Header>

</ns0:Target>

Mapping:

X --> Remove Context --> Sort > Split by value change> Collapse Context --> Header

X --> Remove Context --> Sort > Split by value change> Collapse Context --> Split by each value --> T1

Constant --> Item

Format By example --> I1

(Y --> Remove Context) First Input to Format by example

(X --> remove context --> split by value change) second input to format by example

-Gouri

Former Member
0 Kudos

Hi Gouri,

thanks it worked.

Regards,

Tarun

Answers (0)