![]() |
Enterprise Systems »
Microsoft BizTalk Server »
General
Beginner
Creating Flat File schemas using the BizTalk Server 2006 Flat File Schema WizardBy Naveen KaramchettiAn article explaining how to generate a flat file schema in BizTalk Server 2006 using the Flat file schema wizard |
Windows, .NET, Visual Studio, Dev
|
||||||||||
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
An accurate Flat File schema is very important in every integration project. Several legacy projects have been operational on Flat file format, converting these flat files into XML is vital to the success of any integration project. The new Flat file schema Wizard in BizTalk 2006 is just the right tool for the job. This article shall attempt to explain the various features and things to look out for while creating a flat file schema using the Wizard.
In case you are a newbie to this flat flat structures, please read the following articles on Flat file schemas...
A flat file unlike a XML file, does not have any visible inherent structure. A flat file's structure is evident from its usage and also requires some domain knowledge to understand its representation. A flat file structure is several types
Example - A complex positional flat file
810HDR Invoice 1972-05-12John Doe 810DTL 01-2304040200 $2.34 810DTL 02-4030400400 $1.34 810TOT 600 $1004 810END Steven
810HDR (Total = 50 characters) - Header ID - 10 characters - Description - 10 Characters - Date of Birth - 10 Characters - Full Name - 20 Characters 810DTL (Total = 40 characters) - Detail ID - 10 characters - Part No - 10 characters - Quantity - 10 characters - Price per unit- 10 characters 810TOT (Total = 30 characters) - Total ID - 10 characters - TotalQuantity - 10 characters - TotalPrice - 10 characters 810END (Total = 20 characters) - END ID - 10 characters - ClerkName - 10 characters
Create a new BizTalk Server Project in Visual Studio 2005.
Step 1 : In the Visual Studio 2005 menu, select the File -> New -> Project -> and select "Empty BizTalk Server Project" and type the name "FFSchemaDemo"
Step 2 : In the Solution Explorer, right click on the project name "FFSchemaDemo" and select Add -> New Item. In the "Add New Item" dialog box, select the "Flat File Schema Wizard" and type the Name as "FFSchema_Wiz.xsd".
Step 3 : In the screen that appears specify the flat file (*.txt) location. This will help the Wizard load the file for parsing. Specify the ROOT (Record name) element name for the schema. Observe the Red boxes in the screen shot.
Step 4 : Notice the entire file being loaded into the Wizard with the New line separators (CRLF) being marked visually.
Step 5 : Every line in the flat file is delimited by CRLF, whereas every field within a line is positional. Hence select "By delimiter symbol".
Step 6 : Since every line is separated by CRLF characters, specify this option in the Child Delimiter drop down text box.
Step 7 : Defining Child elements is the most critical part of the Wizard steps. In the example that we considered, there is one Header line, two detail lines, one total line and one end line. The Element name specifies the top level elements that appear in the final schema. The Element type, in the case of a HDR is "Record", since it contains several other positional fields. The Element type for "DTL" is a "Repeating record" since the similar kind of record is repeated on the third line in the file. The Element type for the third line is set to "Ignore", since "DTL" is being repeated on the third line. Note that the "Ignore" option is designed, for this purpose alone. For the subsequent lines, the Element type is set to "Record".
Step 8 : The top level elements are being depicted.
Step 9 : The first line is selected, notice that the line separators are not being selected by default.
Step 10 : We need to specify that the fields in the selected record are positional.
Step 11 : The sizes for each field in a positional record and the Tag Identifier, used to identify each line are being specified. The arrows which fix the column sizes can be toggled by a mouse click. Important : Note that, if there are five fields then you would need to fix only four arrows.
Step 12 : The Field names and types need to be specified for each field.
Last Step : The similar steps need to be followed to complete the field definitions for all the lines in the file.
Once the schema has been generated, validate the schema by right clicking on the file and selecting "Validate Schema" menu option.
The Flat file schema wizard simplifies schema creation. NOTE that the schema wizard expects the complete instance of the flat file to be present for the schema generation. If there are any optional records, they would need to be mapped manually once the schema is created.
C:\ drive.
FlatFilesInput directory in the zip file. | You must Sign In to use this message board. | |||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 20 Apr 2006 Editor: |
Copyright 2006 by Naveen Karamchetti Everything else Copyright © CodeProject, 1999-2009 Web17 | Advertise on the Code Project |