Posted by: techsavygal | March 28, 2006

Flat File Debatching in BTS 2006 – Part II

In earlier part I, we checked out the Customers Record and child elements creation.Lets see how we can create Items and Item fields in the purchaseorder.xsd using Flat File schema wizard.

Lets continue with the wizard:

1. Now we can see the schema with fields under Customers record as below:

                                         PO Schema

2. Now select Items and click Next.

3. On the Select Document Data page, select the entire line begins with ITEMS and click Next to define its child elements.

4. On the Select Record Format page, select By delimiter symbol and click Next.

5. In the Items record, commas are used to delimit the individual items. Therefore, on the Delimited Record page, enter the following to define the items record. When you are done, click Next.

  • Select , from Child delimiter drop down selection list.
  • Leave the Escape character textbox blank.
  • Select Record has tag identifier and type ITEMS in the Tag texbox.
  • In a multiple items record, ITEMS is used to identify each individual record.     

6.  Using the values from the Delimited Record page, the wizard identifies two child elements. Because one of them is a repeating record, select the first element and enter item for Element Name, and then select Repeating Record from the drop down selection list for Element Type. Leave the rest of the default values in the columns. Select the second row and select the Ignore from Element Type list. When you click Next, the next level for the items record is created in the schema.

                                                      PO Screen 2

7. Select item and then click Next to continue on the Schema View page.

8. On the Select Document Data page, select ITEM872-AA|Lawnmower|1|148.95|Confirm this is electric. Click Next to continue.

9. On the Select Record Format page, select By delimiter symbol and click Next.

10.In the Items record, commas are used to delimit the individual items. Therefore, on the Delimited Record page, enter the following to define the items record. When you are done, click Next.

  • Select | from Child delimiter drop down selection list.
  • Leave the Escape character text box blank.

11. On the Child Elements page, the wizard has identified five child elements. Select the first row and enter productCode for Element name. Leave the default values in the rest of the columns. For the rest of the Element Name properties, type the following:

              Element Name                                       Rename To

item_Child2 description
item_Child3 quantity
item_Child4 unitPrice
item_Child5 notes

12. Click Next. You have defined all the nodes of the Purchase Order schema as shown below:

                                                    Final PO Schema

You can validate the above schema by right clicking on the schema in solution explorer and selec Validate schema. If there are any errors with the instance file and your schema, these error messages are displayed in the Output windows else Validation Succeeded message will be displayed in the output window.

Advertisements

Responses

  1. Hello there.

    I may be missing a point, but I have a problem with debatching using the flat file wizard. What I’ve done so far is to export a CSV from excel and try to feed the csv into Biztalk. I encounter two distinct problems.

    The first one is about ignoring the beginning of the file, as it contains trash I don’t want and also info I’d like to process. Forget it unless you have an obvious answer. The second one is my real concern. I tried to debatch using the folowing approach :

    I mapped the CSV file into the following structure : one root (let’s call it ListOfThings) containing the header containing the trash info and one record (called Thing) containing the lines from the excel file. I next created a new root node in the schema (ugly, but it works) containing the structure for the Thing record. I then reinserted a reference to that structure in the ListOfThings root node.

    At that point, my schema contains 2 root nodes : ListOfThings and Thing (which is referenced by ListOfThings).

    I am now able to reference the Thing definition in other schemas easily, but I can’t use it directly, as the root node is still ListOfThings and can’t be changed (probably due to the reference).

    So, where do I go now ? I’d like to be able to use a Thing schema (I could extract each Thing in a loop in an orchestration, or define an envelope schema in a pipeline), but it seems I’m in a dead end.

  2. Hi,

    Did you select your second root node (say Thing) in the Flat File Wizard’s Select Document Data page?

    You can ignore the first node ListOfThings and select Thing! However, you need to be sure that ListOfThings is NOT the ROOT NODE!

    I guess BizTalk Engine checks for XML Wellformed ness based on ROOTNODE and NameSpace Combination!

    Do let me know if it helped!

  3. You have to express more your opinion to attract more readers, because just a video or plain text without any personal approach is not that valuable. But it is just form my point of view

  4. I’m impressed, I need to say. Really hardly ever do I encounter a weblog that’s both educative and entertaining, and let me let you know, you will have hit the nail on the head. Your concept is outstanding; the difficulty is one thing that not sufficient individuals are talking intelligently about. I am very joyful that I stumbled throughout this in my search for something regarding this.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: