|
Home > Archive > BizTalk Server Orchestration > May 2005 > Map/Orch Question - Splitting Messages
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Map/Orch Question - Splitting Messages
|
|
| CranCran77 2005-04-28, 5:55 pm |
| I am trying to develop an orchestration that will take an input XML
document in the following form:
<Order>
<Header>
<Number>1234</Number>
<OrderDate>04/31/2005</OrderDate>
<TotalCost>25.00</TotalCost>
</Header>
<Lines>
<Line>
<Item>00003948432</Item>
<Qty>5</Qty>
<Cost>17.25</Cost>
</Line>
<Line>
<Item>3948321</Item>
<Qty>1</Qty>
<Cost>7.75</Cost>
</Line>
</Lines>
</Order>
I need to split this incoming message so that I can insert 3 records
into my database. The first record represents the order header and the
other 2 represent each individual line. When the lines are inserted, I
also need to include the order number so I can join the values back at
a later point.
Can someone explain how I could do this within BizTalk 2004 via a map
or orchestration process?
| |
| Yves Peneveyre 2005-05-02, 7:47 am |
| Hello !
Getting the order number can be done by multiple ways.
The first is using a property fields and accessing it in your orchestration.
The second is using an xpath expression.
You can then store that number in a orchastration variable, for example.
For splitting your document, you can count the number of lines using an
xpath expression and then
using a loop shape to get individual lines.
In your loop, put a MessageAssignment shape to get the line item you want
with the xpath() function :
msgOneLine = xpath(msgWholeMessage, strXPathExpression);
Your strXPathExpression should look like "/*...... and position()=" +
lineNumber + "]"
Hope it helps
Best Regards
Yves Peneveyre
"CranCran77" <crancran@gmail.com> wrote in message
news:1114729063.517115.267670@g14g2000cwa.googlegroups.com...
> I am trying to develop an orchestration that will take an input XML
> document in the following form:
>
> <Order>
> <Header>
> <Number>1234</Number>
> <OrderDate>04/31/2005</OrderDate>
> <TotalCost>25.00</TotalCost>
> </Header>
> <Lines>
> <Line>
> <Item>00003948432</Item>
> <Qty>5</Qty>
> <Cost>17.25</Cost>
> </Line>
> <Line>
> <Item>3948321</Item>
> <Qty>1</Qty>
> <Cost>7.75</Cost>
> </Line>
> </Lines>
> </Order>
>
> I need to split this incoming message so that I can insert 3 records
> into my database. The first record represents the order header and the
> other 2 represent each individual line. When the lines are inserted, I
> also need to include the order number so I can join the values back at
> a later point.
>
> Can someone explain how I could do this within BizTalk 2004 via a map
> or orchestration process?
>
| |
| CranCran77 2005-05-09, 5:49 pm |
| Yes that is exactly what I ended up doing and that worked great!
Thanks for the suggestion.
Chris
|
|
|
|
|