Creating a New Specification

Let's begin learning about specifications by creating one. We will then move right into working with a predefined specification. To access a blank template, go to the File menu and select New.This will open the New Document Specification dialog box, shown in Figure 5.3.

Figure 5.3 The New Document Specification Dialog Box

Figure 5.3 The New Document Specification Dialog Box

The New Document Specification dialog box contains a Blank Specification icon. Double-click this icon to begin creating a custom specification. (We will call this one PO, which is short for purchase order).

Now that we have begun making a brand new specification, you will see the BizTalk Editor create a new record as shown in Figure 5.2.

1. When you first open the Editor using a blank template, the specification in the left pane of the Editor will have a new record conveniently named Blank Specification. Right-click this document, and within the Properties menu, select Rename. Rename the root record BIZTALKPO. Please note that you cannot use spaces. Again, this record will act as the root of our document specification. (You may also edit the name right in the tree view of the left pane.)

2. Next, we can add some new fields and records to our new specification. Note in Figure 5.2 that we have already added quite a few records and fields for you.We will walk you through the process as shown in Figure 5.2. Right-click the new record named BIZTALKPO, and select New Field from the Properties menu. Create a new field titled Date.This will automatically create the Date field under the root of BIZTALKPO. You can continue to create the fields shown in Figure 5.2. Repeat these steps and create fields for the CustomerNumber, InvoiceNumber, and Registration. Note that you cannot skip spaces when creating records and fields.

3. Next, we will create another record under the root of BIZTALKPO. Right-click the root document and select New Record from the Properties menu. Name this record ITEMLIST.This will serve as a container for other fields within your specification. Once you have created the new record, follow the example described previously in step 2 and create fields for Quantity, Size, Price, and Code.You have now tackled the basics of creating your own specification.

Now, let's drill down a little further.When we made the record for ITEMLIST in step 3 of the previous example, we focused on the left pane of the Editor. Look at the right pane to see the effects of the changes you made to the properties and values of the records and fields.When you look at the record (left-click on BIZTALKPO once), look at the Type field in the right pane of the Editor in the Declaration tab. Notice that it is called an element (Figure 5.2). Now, if you do the same step and left-click on the Date field below it, you can see that it is classified as an attribute in the Type field.

You can always view the actual underlying XML code that the Editor converts to by simply saving the specification and viewing it in Internet Explorer. To do this:

1. Save the specification as BIZTALKPO.xml. Go to the File menu within the BizTalk Editor and select Save. Save the document to your desktop.

2. Next, minimize the Editor.This will allow you to see the documents as XML attachments on your desktop.

3. Finally, view the XML code by right-clicking the new documents and selecting Open With____This will open a dialog box for you to select a program with which to open the document. Select Internet Explorer. You can now view the code and it will appear within the browser.The file shown in Figure 5.4 will open, and will look similar to the code in Figure 5.5.

Was this article helpful?

0 0

Post a comment