Wednesday, 13 March 2013

Flat File Schema in Biztalk

Flat File Schema:  A flat file schema defines the structure of a class of instance messages that use a flat file format, either delimited or positional or some combination thereof.

Several Legacy system are based on flat files .So conversion of flat files to xml is required in integration projects.

A Flat Files is of several Types:
  • ·         Delimiter,
  • ·         Positional and
  • ·         Combination of both.

Biztalk provides Flat File Schema Wizard for creating flat files Schemas.

In this article we will develop flat file schema for complex file using flat file schema wizard

BILLTO,US,John Connor,123 Cedar Street,Mill Valley,CA,90952
101-TT         Plastic flowers   10   4.99      Fragile handle with care
202-RR         Fertilizer        1    10.99     Lawn fertilizer        
453-XS         Weed killer       1    5.99      Lawn weed killer       

In this flatfile there are 4 Type of record

Step 1: Create New Biztalk Project
Step 2: Add New Item, Select Flat File Schema Wizard

Step 3: Select Instance File.

Step 4 : Every line in the flat file is delimited by CRLF , hence  Select option  By Delimiter Symbol.

Step 5: Select Child delimiter as {cr}{lf}.

Step 6: Define Child elements .

·         The Elements type in case of Destination partner and bill to is record because it has more delimiter based fields.
·         The Elements type in case of Item is repeating record because it is repeating several times.

Step 7: define field properties for each type of record.

Step 8: Destination partner have field with Delimiter (: ) , so select delimiter.

Step 9: BillTo record is based on delimiter (,) , hence select by Delimiter symbol option.

Step 10: now record item is position based, so define the position of each element.

After generating the Schema, right click on schema and validate the instance

Wednesday, 6 March 2013

convert flat structure into hierarchal using Table Looping Functoid

This tutorial describes how to convert flat structure schema to hierarchal schema using Table Looping functoid.

Input Schema: FlatStructure.xsd

Target Schema:

Map for conversion:

Input Instance for Test:

<ns0:FlatStructure xmlns:ns0="http://Company.Demo.TableFunctoid.FlatStructure">

Output Instance :

<ns0:HierarchyStructure xmlns:ns0="http://Company.Demo.TableFunctoid.HierarchyStructure">

Use of Gated Checkbox :

When you select this check box, you are specifying that the value of the data specified for column 1 controls whether any processing is performed for that row. When this is output from a logical functoid, if the value specified in column 1 evaluates to False, the associated row of the grid is skipped (meaning that the associated Table Extractor functoids are not invoked for that row).

Code Available Here