cancel
Showing results for 
Search instead for 
Did you mean: 

Issue regarding a Message Mapping

Former Member
0 Kudos

Dear friends,

I've a issue regarding message mapping within PI 7.0

This is how my source structure looks like:

<stop>

<stopreference/>

<action>

<actionreference/>

<shipment>

<shipmentreference/>

<goods>

<goodsexternalreference/>

</goods>

</shipment>

</action>

</stop>

This is how my target structure looks like:

STOPDETAILS>

<item>

<EXTERNAL_STOP/>

<EXTERNAL_ACTION/>

<EXTERNAL_SHIP/>

<EXTERNAL_GOOD/>

</item>

</STOPDETAILS>

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

My target message is a flat XML structure...

The customer wants to see, 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...

Do you have a suggestion how to do that?

Kind regards,

Kamran

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member182004
Contributor
0 Kudos

Hi Kamran,

In the above example that you posted, it'd have to make 4 items nodes... isn't it ?

Former Member
0 Kudos

I don't think so because I dont know how many times those fields will be presented by the source system. And the information has to be related to eachother.

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...

Edited by: Kamran Vakili on Jul 30, 2009 5:05 PM

former_member182004
Contributor
0 Kudos

So, you have to look in the source from down, to top.. otherwise you'll have repeated ITEMS in the target structure.

Isn't it?

regards,

Former Member
0 Kudos

Exactly,

I have used useOneAsMany from down to top but I also have to know how many times the Action, Shipment and Goods occure.

So I'm guessing a Loop?

former_member182004
Contributor
0 Kudos

Hello Kamran,

I have a doubt about your source structure:

Would it be like this?


   <STOP>
      <Stops>Stop 1</Stops>
      <ACTIONS>
         <Accion>Accion 1</Accion>
         <SHIPMENTS>
            <Shipment>Shipment 1</Shipment>
            <GOODS>
               <Good>Good 1</Good>
            </GOODS>
            <GOODS>
               <Good>Good 2</Good>
            </GOODS>
         </SHIPMENTS>
      </ACTIONS>
   </STOP>
</ns0:MT_ORIGENNNNNNNN>

Or like this ? ( in this case the subelements are reapeated, and not the whole subtree)

 
   <STOP>
      <Stops>Stop 1</Stops>
      <Stops>Stop 2</Stops>
      <Stops>Stop 3</Stops>
      <ACTIONS>
         <Accion>Accion 1</Accion>
         <Accion>Accion 2</Accion>
         <SHIPMENTS>
            <Shipment>Shipments 1</Shipment>
            <Shipment>Shipments 2</Shipment>
            <Shipment>Shipments 3</Shipment>
            <GOODS>
               <Good>Goods 1</Good>
               <Good>Goods 2</Good>
               <Good>Goods 3</Good>
            </GOODS>
         </SHIPMENTS>
      </ACTIONS>
   </STOP>
</ns0:MT_ORIGENNNNNNNN>

Regards,

Juan

Former Member
0 Kudos

Hi,

It's eg looks like this:

<stop>

<stopreference/>

<stopstatus>

<id/>

<description/>

</stopstatus>

<action>

<actionreference>1</actionreference>

<timestamp/>

<shipment>

<shipmentreference>1a</shipmentreference>

<goods>

<goodsreference>1aa</goodsreference>

</goods>

<goods>

<goodsreference>1bb</goodsreference>

</goods>

</shipment>

<shipment>

<shipmentreference>1b</shipmentreference>

<goods>

<goodsreference/>

</goods>

</shipment>

</action>

<action>

<actionreference>2</actionreference>

<timestamp/>

<shipment>

<shipmentreference>2a</shipmentreference>

<goods>

<goodsreference>2aa</goodsreference>

</goods>

</shipment>

</action>

</stop>

Former Member
0 Kudos

Hey

Please use the formatting markups available on SDN when you post XML,code or anything like that

it becomes really hard to comprehend what exactly is the structure.

To post XML you need to use the tags.

Thanks

Aamir

Former Member
0 Kudos

Sorry,

Forgot that...Here again the code..

<stop>
   <stopreference/>
   <stopstatus>
      <id/>
      <description/>
   </stopstatus>
   <action>
      <actionreference>1</actionreference>
      <timestamp/>
      <shipment>
         <shipmentreference>1a</shipmentreference>
         <goods>
            <goodsreference>1aa</goodsreference>
         </goods>
         <goods>
            <goodsreference>1bb</goodsreference>
         </goods>
      </shipment>
      <shipment>
         <shipmentreference>1b</shipmentreference>
         <goods>
            <goodsreference/>
         </goods>
      </shipment>
   </action>
   <action>
      <actionreference>2</actionreference>
      <timestamp/>
      <shipment>
         <shipmentreference>2a</shipmentreference>
         <goods>
            <goodsreference>2aa</goodsreference>
         </goods>
      </shipment>
   </action>
</stop>

Former Member
0 Kudos

And this is the target structure...

<STOPDETAILS>
      <item>
         <EXTERNAL_STOP/>
         <ADRNZ/>
         <TIMESTAMP/>
         <TIMESTAMPSTART/>
         <TIMESTAMPSTOP/>
         <ID_STOP/>
         <DESCR_STOP/>
         <EXTERNAL_ACTION/>
         <TIMESTAMP_ACTION/>
         <ID_ACTION/>
         <DESCR_ACTION/>
         <EXTERNAL_SHIP/>
         <ID_SHIPM/>
         <DESCR_SHIP/>
         <EXTERNAL_GOOD/>
         <ID_GOOD/>
         <DESCR_GOOD/>
      </item>
   </STOPDETAILS>
</ns0:ZMOBISSTOPDETAILS>

Former Member
0 Kudos

So what the custimer want is for every stop or action or shipment or goods in the source structure a new Item in the target structure...

Edited by: Kamran Vakili on Jul 30, 2009 4:10 PM

Former Member
0 Kudos

Anyone an Idea???

Thanks!!!

Former Member
0 Kudos

Hi,

I suugest to use an XSLT mapping as step in your message mapping. Infomation about XSLT you can get here:

http://www.w3schools.com/xsl/

http://www.w3.org/TR/xslt

Regards,

Kai

Former Member
0 Kudos

Hi Kai,

I've to solve it in message mapping...

Former Member
0 Kudos

XSLT is within meassage mapping ;o)

Or do you mean graphical mapping?

Former Member
0 Kudos

Exactly... Graphical mapping