August 22, 2007

BizTalk Table Looping functoid scenario

Recently, I was mapping one schema to another using the BizTalk mapping tool, and I came across a transformation requirement that was a good case for using the Table Looping and Table Extracting functoids:

The source schema contained a product entity and this entity had multiple (up to 3) vendors in the product schema like:

<product>
<productId>1>/productId>
<globalVendorRelatedInfo>vendorInfo>/globalVendorRelatedInfo>
<otherProductInfo>info>/otherProductInfo>
<vendorCode1>1>/vendorCode1>
<vendorCode2>2>/vendorCode2>
<vendorCode3>3</vendorCode2>
<product>


the destination schema required that the vendors be a repeating element inside a vendors parent element. So basically the xml data needed to be normalized. Below is the mapping grid required:
TableLooping01

The first parameter is the scoping parameter... for these purposes, I just have it hard-coded to 3, since there are 3 vendors. The second parameter specifies the number of columns per row. After that, any fields or values required must be added. Make sure to name your links, otherwise, the field parameter names will default to the unwieldy xpath query string. Drag a link from the Table Looping functoid to the target element in the destination schema.
TableLooping02

After that, configure the columns to contain the required data. If you require that no destination record be created, select the Gating checkbox, and give the first column a boolean value. If the first column is false, no destination record will be created for that row.
TableLooping03

Then create a Table Extracting functoid for each column and specify the Table Looping functoid, and column number.
TableLooping04

Share |

4 comments:

  1. Have you ever tried with the first value a dynamic int?
    I'm getting errors when I try with a dynamic value.

    ReplyDelete
  2. This magnificent idea is necessary just by the way

    ReplyDelete
  3. Hi,

    Can we user Table looping funtdoid on opposite scenario. like where we have input data on SUB Loop and on destination is should be on Flat file

    Thanks & Regards:
    Himanshu Thawait

    ReplyDelete
  4. Hi,

    Can we user Table looping funtdoid on opposite scenario. like where we have input data on SUB Loop and on destination is should be on Flat file

    ReplyDelete