Skip to Content
0
Former Member
Jul 31, 2009 at 02:08 PM

Nested structure to flat structure in the PI mapping

266 Views

Dear friends,

I've a issue regarding message mapping within PI 7.0

This is how my source structure looks like:

<?xml version="1.0" encoding="UTF-8"?>
<stop>
   <stopreference/>
   <action>
      <actionreference>1</actionreference>
      <shipment>
         <shipmentreference>11</shipmentreference>
         <goods>
            <goodsreference>111</goodsreference>
         </goods>
         <goods>
            <goodsreference>111</goodsreference>
         </goods>
      </shipment>
   </action>
   <action>
      <actionreference>2</actionreference>
      <shipment>
         <shipmentreference>22</shipmentreference>
         <goods>
            <goodsreference>222</goodsreference>
         </goods>
      </shipment>
   </action>
</stop>

The target structure looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Test>
   <STOPDETAILS>
      <item>
         <EXTERNAL_STOP/>
         <EXTERNAL_ACTION/>
         <EXTERNAL_SHIP/>
          <EXTERNAL_GOOD/>
        </item>
   </STOPDETAILS>
</Test>

In the source message the stop is the header and within a stop there can be 0 or more actions, within action there can be 0 or more shipments and within a shipment there can be 0 or more goods...

My target message is a flat XML structure...

The customer wants to see an Item target structure for every goods, the shipment, the action and the stop. If the there are no goods, they wants just to see the shipment, the action and the stop...and so on...

So its look like this:

stop 1 - action 1 - shipment 1 - good 1

stop 1 - action 1 - shipment 1 - good 2

stop 1 - action 1 - shipment 2 - good 1

stop 1 - action 1 - shipment 2 - good 2

stop 1 - action 2 - shipment 1 - good 1

stop 1 - action 2 - shipment 1 - good 2

And so on...

I've to solve this issue in the Graphical Mapping...

Do you have a suggestion how to do that?

Kind regards,

Kamran