Using Looping functoid in BizTalk Map:
1. Create two schema, Order schema and MasterOrderSchema with below shown structure.
2. OrderSchema will have order from multiple companies, using “LOOPING” functoid we will map it to MasterOrdeeShema.
3. We will create a map to achieve this, in this map we will use Looping functoid (Advanced Functoid Grp).
Order Schema
MasterOrderSchema
Map – OrderSchemaToMasterOrderSchema.btm
Now test the map created with input instance Order.xml file
<ns0:Order xmlns:ns0="http://LoopinFunctoidSoln.OrderSchema">
<ABCCompany>
<ID>11</ID>
<ItemName>ItemName_0</ItemName>
<Qty>10</Qty>
</ABCCompany>
<PQRCompany>
<ID>1</ID>
<ItemName>ItemName_1</ItemName>
<Qty>2</Qty>
</PQRCompany>
<XYZCompany>
<ID>2</ID>
<ItemName>ItemName_2</ItemName>
<Qty>5</Qty>
</XYZCompany>
</ns0:Order>
And we will get output as MasterOrder.xml file as shown below.
<ns0:MasterOrder xmlns:ns0="http://LoopinFunctoidSoln.OrderSchema">
<Company>
<ID>11</ID>
<ItemName>ItemName_0</ItemName>
<Qty>10</Qty>
</Company>
<Company>
<ID>1</ID>
<ItemName>ItemName_1</ItemName>
<Qty>2</Qty>
</Company>
<Company>
<ID>2</ID>
<ItemName>ItemName_2</ItemName>
<Qty>5</Qty>
</Company>
</ns0:MasterOrder>
Comments
Post a Comment