on 07-30-2009 1:03 PM
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
Hi Kamran,
In the above example that you posted, it'd have to make 4 items nodes... isn't it ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
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>
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>
Anyone an Idea???
Thanks!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I suugest to use an XSLT mapping as step in your message mapping. Infomation about XSLT you can get here:
Regards,
Kai
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.