cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Help Needed

Former Member
0 Kudos

Hi all,

I need to do the below message mapping:

Source

Group_1 (0..n)

|--HL (1..1)

|---HirarchicalIDNumber(1..1)

|---ParentIdNumber(0..1)

|---Code (Can be S (shipment), O-Order, I-Item) (1..1)

Target:

Shipment

|--Order (1..n)

|--LevelCode (1..1)

|--PONumber (1..1)

I need to map Group to Order in such a way that below condition is satisfied:

Group_1/HL/Code='O' and ParentIDnumber= Shipment Group/ HirarchicalIDNumber

I need to make a tree on target such that all the Orders belonging to same Shipment are together on target side by comparing Code and ParentID number .Can any body please suggest

Any help will be really appriciated.

Thanks,

-Kulwant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kulwant,

You should use the below logic to create the target Order node :

Group_1/HL/Code
              equals ------------
             'O' 
                                   And  --------- Createif ------ CollapseContext ----- Order
    ParentIDnumber
                equals ------------
HirarchicalIDNumber

Thanks,

Pooja

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Kulwant,

I'm not sure which is the real requirement. Please clarify between the two:

I need to map Group to Order in such a way that below condition is satisfied:

Group_1/HL/Code='O' and ParentIDnumber= Shipment Group/ HirarchicalIDNumber

or

I need to make a tree on target such that all the Orders belonging to same Shipment are together on target side by comparing Code and ParentID number

The first one would only concentrate in the Code = 'O', but the second one would need to take into consideration all Codes (S, O and I)

Regards,

Former Member
0 Kudos

Hello dspboys,

Yes, This is the second case. Firstly we need to one would concentrate on Order 'O" lonly while for second comparision, we need to concentrate on all the nodes.

Can you help.

@pooja, That didn't helped. Can you please suggest again

Thanks,

Kulwant

Former Member
0 Kudos

Hi Kulwant,

Can you provide the sample input and expected output, then it will be easier to understand the requirement clearly ?

Thanks,

Pooja pandey

Former Member
0 Kudos

Hello Pooja,

Although i don't have testing data but still i can explain as here:

Source:

Group(0..n)

|-- ID

|-- Code (Can be S-Shipment, O-Order, I - Item)

|-- Parent ID

Example: Source

<GROUP>

<ID>S1001</ID>

<CODE>S</CODE>

<PARENTID></PARENTID>

</GROUP>

<GROUP>

<ID>O1001</ID>

<CODE>O</CODE>

<PARENTID>S1001</PARENTID>

</GROUP>

<GROUP>

<ID>O1002</ID>

<CODE>O</CODE>

<PARENTID>S1001</PARENTID>

</GROUP>

<GROUP>

<ID>I1001</ID>

<CODE>I</CODE>

<PARENTID>O1001</PARENTID>

</GROUP>

Target:

Shipment(1..1)

|--Order(1..n)

|--Level Code(1..1)

|--PO Number(1..1)

|--Item(1..n)

|--LevelCode(1..1)

|--ItemNumber(1.1)

Example Output:

<Shipment>

<ORDER>

<LEVELCODE>O</LEVELCODE>

<PONUMBER>O1001</PONUMBER>

<ITEM>

<LEVELCODE>I</LEVELCODE>

<ItemNUMBER>I1001</PONUMBER>

</ITEM>

</ORDER>

<ORDER>

<LEVELCODE>O</LEVELCODE>

<PONUMBER>O1002</PONUMBER>

</ORDER>

</Shipment>

Former Member
0 Kudos

Hi Kulwant,

Will the data come in the order of the CODE ? ( "S"...."S"....."O"..."O"...."I"...."I").

Or can it be in a mixed order ? ( "S"..."O".."S"..."O"...."I"...."S"..."I").

Thanks,

Pooja Pandey

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Kulwant,

It is not possible to have the desired output using the current target structure since Order 1..n and Item: 1..n are both independent of each other. What you can do is to modify the target structure from:

+Target:

Shipment(1..1)

|--Order(1..n)

|--Level Code(1..1)

|--PO Number(1..1)

|--Item(1..n)

|--LevelCode(1..1)

|--ItemNumber(1.1)+

to

Shipment(1..1)

|--Order(1..n)

|----Level Code(1..1)

|----PO Number(1..1)

|----Item(1..n)

|-------LevelCode(1..1)

|-------ItemNumber(1..1)