Stephen W. Thomas BizTalk Blog

100% Pure BizTalk
posts - 133, comments - 195, trackbacks - 427

My Links

News

Subscribe to my blog via:


Add to Google

Visit my website at:
www.BizTalkGurus.com

Archives

BizTalk 2004 Samples

BizTalk 2006 Samples

BizTalk Videos

BizTalk White Papers

BizTalkBlogs.com

Great BizTalk Blogs

Other Links

Creating Nodes from Flat Data in BizTalk 2004 Maps

It can sometimes be challenging when mapping schemas in BizTalk 2004.  One common problem is when the inbound document has one record and the source creates multiple records based on the data inside your single record.

 

The root problem arises because you have nothing to loop around in the inbound document and need to create multiple nodes on the output.

 

How can this be handled in the mapper?

 

Two ways: Functoids or XSLT Template

 

BizTalk 2004 introduces a new Functoid just for this situation.  It is called the Table Looping Functoid.  It is accompanied by the Table Looping Functoid Data Extractor.  The table looping functoid will take a flat row of data and produce multiple nodes of data on the destination schema.

 

CRITICAL: The key to working with the table looping functoid is to label your links.  This can be done by selecting the link and going to Properties.  Under General you can set the label.  This will show up inside the Input Parameters section of your functoids as the label name.

 

An alternative to the Table Looping Functoid is to use a custom XSLT Template call inside a scripting functoid. This requires error prone XSLT coding.

 

In both cases, the number of input parameters must be known ahead of time.

 

I have put together a sample showing both the Table Looping Functoid and XSLT Template solutions.

 

DOWLOAD: Sample Create Nodes in Maps

 

In addition to Node Creation, this sample includes a map called Map_RowSplit.  This sample takes an order item and evaluates the node for “Y” (meaning the item is gift wrapped).  If it is “Y” two line items are created on the output rather then one.  This uses the and XSLT element.

Print | posted on Thursday, October 28, 2004 9:48 PM |

Feedback

Gravatar

# re: Creating Nodes from Flat Data in BizTalk 2004 Maps

But when I have an xml inbound document has multirecord source file and need to create one record (one row) on outbound. how to mapit?
11/3/2004 3:15 AM | Micheal
Gravatar

# re: Creating Nodes from Flat Data in BizTalk 2004 Maps

this solution helps me a lot!
thank you very much!

Regards!
3/24/2005 3:42 AM | Liang Jun
Gravatar

# re: Creating Nodes from Flat Data in BizTalk 2004 Maps

Hi,
How did you create that "BaseNODE" parameter in a looping functoid?
5/11/2006 12:15 PM | Yakov
Gravatar

# re: Creating Nodes from Flat Data in BizTalk 2004 Maps

If you notice in his map, the link coming from OrderLine1 is labeled BaseNODE.
6/15/2006 12:19 PM | Paul B
Gravatar

# re: Creating Nodes from Flat Data in BizTalk 2004 Maps

you are a saviour.
4/4/2007 9:56 AM | CG
Gravatar

# re: Creating Nodes from Flat Data in BizTalk 2004 Maps

How can we achieve exactly the reverse scenario. I am getting multiple records. One of the column will hold the group ID and another will hold the Sequence No. There are 38 other columns and each group can have upto 15 records.

If the groupID is same I have to take record for sequence #1 and place it in the first place holders and sequence #2 at 2nd place holders. We tried this using XSLT and it is working. However, I would like to know if the Biztalk 2006 provides any alternate solution to do that.

Your help is really appriciated.

12/19/2007 12:01 PM | Nehal Jain
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 

Powered by: