BizTalk Server Orchestration - BizTalk Conditional looping + suppress parent...

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > September 2005 > BizTalk Conditional looping + suppress parent...





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 BizTalk Conditional looping + suppress parent...
Kiran Pabba

2005-09-07, 5:52 pm

Hi,

I have a requirement where I need to map xml schema that holds order
records that hold both header and line details of many orders in
sequence into a structured Order Header-Line format.[Basically header
information is redundant per line in an order] and now I need to map
this information into a structure where I need to identify the header
and related lines and put them in a xml schema format as mentioned
below. To acheive this I have created a Inline C# code that identifies
the new header and returns true or false [Code is somethinglike if 4
elements(CompanyNumber, DivisionCode, BranchNumber, CustomerPO) in the
header have same values that means this is one order header and
associated other attributes are lines.]. In the map, making use of the
conditional looping I am trying to create a single Header node and
associate related lines to this Order. I am able to succeed in creating
the Header and getting the details also but since Header and Line nodes
are at the same level I am getting the line nodes with the parent
node(Order) since the conditional looping is set first I am getting the
first Order with Header and related line properly but when its looping
thru the second input record BizTalk is generating the root again and
creating the first order's second line under this root node though
Header is suppressed I am not getting the expected output.


Input Schema:


<LegacyOrder>
<Record>
<CompanyNumber>
<DivisionCode>
<BranchNumber>
<CustomerPO>
<ProductCode>
<OrderedQuantity>
<RequestedDeliveryDate>
<CancelDate>
<EntryDate>
</Record>
</LegacyOrder>


Output Schema:


<MyOrders>
<Order>
<Header>
<Source>
<CompanyNumber>
<DivisionCode>
<ControlNumber>
<SoldToCustomerNumber>
<PONumber>
<FormCode>
<EntryDate>
<RequestedDeliveryDate>
<CancelDate>
<TotalLines>
<TotalUnits>
<SpecialInstructions1>
<SpecialInstructions2>
<SpecialInstructions3>
</Header>
<Details>
<Detail>
<ProductCode>
<Quantity>
</Detail>
</Details>
</Order>
</MyOrders>


Input XML Data:


<LegacyOrder>
<Record>
<CompanyNumber>10</CompanyNumbÂ_er>
<DivisionCode>0004</DivisionCoÂ_de>
<BranchNumber>11579</BranchNumÂ_ber>
<CustomerPO>7785641</CustomerPÂ_O>
<ProductCode>111700</ProductCoÂ_de>
<OrderedQuantity>00003</OrdereÂ_dQuantity>
<RequestedDeliveryDate>2002-07Â_-27</RequestedDeliveryDate>
<CancelDate>2002-08-13</CancelÂ_Date>
<EntryDate>2002-07-19</EntryDaÂ_te>
</Record>
<Record>
<CompanyNumber>10</CompanyNumbÂ_er>
<DivisionCode>0004</DivisionCoÂ_de>
<BranchNumber>11579</BranchNumÂ_ber>
<CustomerPO>7785641</CustomerPÂ_O>
<ProductCode>113500</ProductCoÂ_de>
<OrderedQuantity>00003</OrdereÂ_dQuantity>
<RequestedDeliveryDate>2002-07Â_-27</RequestedDeliveryDate>
<CancelDate>2002-08-13</CancelÂ_Date>
<EntryDate>2002-07-19</EntryDaÂ_te>
</Record>
<Record>
<CompanyNumber>10</CompanyNumbÂ_er>
<DivisionCode>0004</DivisionCoÂ_de>
<BranchNumber>11579</BranchNumÂ_ber>
<CustomerPO>7785641</CustomerPÂ_O>
<ProductCode>116100</ProductCoÂ_de>
<OrderedQuantity>00003</OrdereÂ_dQuantity>
<RequestedDeliveryDate>2002-07Â_-27</RequestedDeliveryDate>
<CancelDate>2002-08-13</CancelÂ_Date>
<EntryDate>2002-07-19</EntryDaÂ_te>
</Record>
</LegacyOrder>


Expected Output:


<MyOrders>
<Order>
<Header>
<CompanyNumber>10</CompanyNumbÂ_er>
<DivisionCode>0004</DivisionCoÂ_de>
<SoldToCustomerNumber>11579</SÂ_oldToCustomerNumber>
<PONumber>7785641</PONumber>
<EntryDate>2002-07-19</EntryDaÂ_te>

<RequestedDeliveryDate>2002-07Â_-27</RequestedDeliveryDate>
<CancelDate>2002-08-13</CancelÂ_Date>
</Header>
<Details>
<Detail>
<ProductCode>111700</ProductCoÂ_de>
<Quantity>00003</Quantity>
</Detail>
</Details>


<Details>
<Detail>
<ProductCode>113500</ProductCoÂ_de>
<Quantity>00003</Quantity>
</Detail>
</Details>
<Details>
<Detail>
<ProductCode>116100</ProductCoÂ_de>
<Quantity>00003</Quantity>
</Detail>
</Details>
</Order>
<MyOrders>


Present Output - If I place a looping functoid between source Record node
and target Order node:


<MyOrders>
<Order>
<Header>
<CompanyNumber>10</CompanyNumbÂ_er>
<DivisionCode>0004</DivisionCoÂ_de>
<SoldToCustomerNumber>11579</SÂ_oldToCustomerNumber>
<PONumber>7785641</PONumber>
<EntryDate>2002-07-19</EntryDaÂ_te>

<RequestedDeliveryDate>2002-07Â_-27</RequestedDeliveryDate>
<CancelDate>2002-08-13</CancelÂ_Date>
</Header>
<Details>
<Detail>
<ProductCode>111700</ProductCoÂ_de>
<Quantity>00003</Quantity>
</Detail>
</Details>
</Order>
<Order>
<Details>
<Detail>
<ProductCode>113500</ProductCoÂ_de>
<Quantity>00003</Quantity>
</Detail>
</Details>
</Order>
<Order>
<Details>
<Detail>
<ProductCode>116100</ProductCoÂ_de>
<Quantity>00003</Quantity>
</Detail>
</Details>
</Order>
<MyOrders>

The parent node i.e Orders is repeating for each detal/line. How to
supress this node?

Present Output - If I place a looping functoid between source Record node
and target Detail node:

<MyOrders>
<Order>
<Header>
<CompanyNumber>10</CompanyNumbÂ_er>
<DivisionCode>0004</DivisionCoÂ_de>
<SoldToCustomerNumber>11579</SÂ_oldToCustomerNumber>
<PONumber>7785641</PONumber>
<EntryDate>2002-07-19</EntryDaÂ_te>

<RequestedDeliveryDate>2002-07Â_-27</RequestedDeliveryDate>
<CancelDate>2002-08-13</CancelÂ_Date>
</Header>
<Header>
<CompanyNumber>20</CompanyNumbÂ_er>
<DivisionCode>0004</DivisionCoÂ_de>
<SoldToCustomerNumber>10579</SÂ_oldToCustomerNumber>
<PONumber>7785643</PONumber>
<EntryDate>2002-07-19</EntryDaÂ_te>

<RequestedDeliveryDate>2002-07Â_-27</RequestedDeliveryDate>
<CancelDate>2002-08-13</CancelÂ_Date>
</Header>
<Details>
<Detail>
<ProductCode>111700</ProductCoÂ_de>
<Quantity>00003</Quantity>
</Detail>
</Details>
</Order>
<Order>
<Details>
<Detail>
<ProductCode>113500</ProductCoÂ_de>
<Quantity>00003</Quantity>
</Detail>
</Details>
</Order>
<Order>
<Details>
<Detail>
<ProductCode>116100</ProductCoÂ_de>
<Quantity>00003</Quantity>
</Detail>
</Details>
</Order>
<MyOrders>

The Header node repeates based on the condition but the details are also
seperated. But need to get the required output as given above. This would be
due to the scripting functoid code but I can't avoid that.

Appreciate if some one can help resolve this...

TIA,
Kiran
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com