Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

BizTalk 2010 Recipes : Document Mapping - Using the Table Looping Functoid

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
3/27/2011 8:46:55 PM

1. Problem

You need to create a repeating structure in an output document with no equivalent repeating structure in an input document.

2. Solution

BizTalk Sever provides two functoids, the Table Looping functoid and the Table Extractor functoid, for creating a repeating node structure from a flattened input structure, from constant values, and from the output of other functoids. The Table Looping functoid is used to create a table of information based on inputs. The functoid will generate output for each row from this table. The Table Extractor functoid is used to direct data from each column in the table to a node in the destination document. Following are the basic steps for configuring these functoids.

  1. Click the Toolbox, and then click the Advanced Functoids tab. Drag the functoid onto the map surface, and create links to the functoid.

    1. Set the first input parameter, which is a link from a node structure in the input document that defines the scope of the table. If this node repeats in the input document, the number of occurrences of this element in the input document will be used to control the number of times the set of Table Extractor functoids will be invoked at runtime.

    2. Set the second input parameter, which is a constant that defines the number of columns for each row in the table.

    3. Set the next input parameters, which define the inputs that will be placed in the table. These inputs can come from the input document, the output from other functoids, constant values, and so on.

  2. Configure the table based on inputs for the Table Looping functoid.

    1. Select the ellipsis next to the TableFunctoidGrid property in the Properties window to launch the Table Looping Configuration dialog box.

    2. For each cell, select a value from the drop-down list. The drop-down list will contain a reference to all of the inputs you defined in step 1c.

    3. Check or uncheck the Gated check box. If checked, column 1 will be used to determine whether a row in the table should be processed as follows: When the value in column 1 of the row is the output from a logical functoid, if the value is True, the row is processed, and if the value is False, the row is not processed. Similarly, if the value in column 1 of the row is from a field, the presence of data equates to True, and the row is processed, and the absence of data equates to False, and the row is not processed and subsequently missing from the output structure.

    4. Select OK to close the dialog box.

  3. Configure the outputs for the Table Looping functoid.

    1. Link the Table Looping functoid to the repeating node structure in the output document.

    2. Link the Table Looping functoid to a Table Extractor functoid for each column in the table. The Table Extractor functoid can be found in the Toolbox on the Advanced Functoids tab.

  4. Configure the input parameters for each Table Extractor functoid.

    1. Set the first input parameter, which is the output link from the Table Looping functoid.

    2. Set the second input parameter, which is the column number of the data to be extracted from the table.

  5. Configure the outputs for each Table Extractor functoid. Link the functoid to a node in the destination schema that is part of a repeating structure.

NOTE

It is very helpful to label all of the links so that meaningful names are displayed when configuring these functoids.

3. How It Works

The Table Looping and Table Extractor functoids are used together. As an example, suppose that you have the sample input document shown in Listing 1.

Example 1. Flattened Input Structure
<AliasesFlat>
<Names>
<Alias1FirstName>John</Alias1FirstName>
<Alias1LastName>Doe</Alias1LastName>
<Alias2FirstName>Sam</Alias2FirstName>
<Alias2LastName>Smith</Alias2LastName>
<Alias3FirstName>James</Alias3FirstName>
<Alias3LastName>Jones</Alias3LastName>
</Names>
</AliasesFlat>

The goal is to use these two functoids to create an output document of the format shown in Listing 2.

Example 2. Repeating Nested Structure
<AliasesRepeating>
<AliasNames>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
</AliasNames>
<AliasNames>
<FirstName>Sam</FirstName>
<LastName>Smith</LastName>
</AliasNames>
<AliasNames>
<FirstName>James</FirstName>
<LastName>Jones</LastName>
</AliasNames>
</AliasesRepeating>

Figure 1 shows the configuration for the input parameters for the Table Looping functoid. The first parameter is a reference to the node structure Names in the input schema. The second parameter is a constant value of 2 indicating there will be two columns in the table. The remaining parameters are the first and last name of each alias from the input document.

Figure 1. Table Looping input parameters

Figure 2 shows the completed Table Looping Configuration dialog box for the Table Looping functoid. It has been configured so that each row contains an alias first name in column 1 and an alias last name in column 2. There will be three rows in the table to process, one for each alias provided as input.

Figure 2. Table Looping Configuration dialog box

The output links from the Table Looping functoid are configured as follows:

  • An output link to the AliasNames repeating node structure in the destination schema

  • An output link to a Table Extractor functoid for processing first names (column 1) from the table

  • An output link to a Table Extractor functoid for processing last names (column 2) from the table

Figure 3 shows the configuration for the Table Extractor functoid that will process column 1 from the table. The first parameter is a link from the Table Looping functoid, and the second parameter is a constant value of 1, which indicates it will process the first column from each row as it is processed.

Figure 3. Table Extractor functoid configuration for column 1

Figure 4 shows the configuration for the Table Extractor functoid that will process column 2 from the table. The first parameter is a link from the Table Looping functoid, and the second parameter is a constant value of 2, which indicates it will process the second column from each row as it is processed.

Figure 4. Table Extractor functoid configuration for column 2

Finally, each Table Extractor functoid must be linked to a node in the destination schema. The complete map is shown in Figure 5.

Figure 5. Final map for the Table Looping functoid example

Here is what the data table will look like when the map is processed:

Column 1Column 2
JohnDoe
SamSmith
JamesJones

Once the table is loaded, it will generate three sets of output: one set of output for each row in the table. This, in turn, will create three repetitions of the AliasNames node structure in the destination document: one for each row in the table. A repeating node structure has been created, even though one did not exist in the input document.

Other -----------------
- BizTalk 2010 Recipes : Document Mapping - Using the Value Mapping Functoids
- BizTalk 2010 Recipes : Document Mapping - Mapping Any Element Nodes
- BizTalk 2010 Recipes : Document Mapping - Adding and Configuring Mapping Constants
- Windows Server 2003 : Troubleshooting Server Services (part 2) - Using Service Recovery Options to Diagnose and Resolve Service-Related Issues
- Windows Server 2003 : Troubleshooting Server Services (part 1) - Diagnosing and Resolving Issues Related to Service Dependency
- Windows Server 2008 Server Core : Virus and External Intrusion Protection (part 4) - Configuring Local Security Policies with the SecEdit Utility
- Windows Server 2008 Server Core : Virus and External Intrusion Protection (part 3) - Verifying Drivers with the Verifier Utility
- Windows Server 2008 Server Core : Virus and External Intrusion Protection (part 2) - Verifying System Files with the SFC Utility
- Windows Server 2008 Server Core : Virus and External Intrusion Protection (part 1)
- Windows Server 2008 Server Core : Managing System Users - Discovering User Identity with the WhoAmI Utility
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server