Considerations for Tracking and Querying Document Specific Data

In addition to the schema validation benefits obtained by using a document specification within your document definition, you gain the ability to track specific fields in your documents to the BizTalk tracking database in SQL Server. As a messaging channel receives a document, it looks to a document definition to describe the format of the document.The document definition describes the location of key document fields, or the important data structures contained by your document. The fields you select here are known as global tracking fields, because these fields are tracked for all documents imported by all channels that reference this document definition. This feature is useful in cases where your business needs require you to have easy access to fields.

In order to better see how to accomplish this and what benefits it yields, we will now create a new document definition. This document definition will represent an invoice document that we plan to receive from a trading partner. Because the company management requires access to important information about the invoices that pass through our system, we will need to track certain pieces of information for each invoice document that arrives.This document definition will be named Tracking Invoice and reference the same "CommonInvoice.xml" document specification from before. Field tracking options are available in the Global Tracking tab of this property sheet, as seen in Figure 4.3.

Figure 4.3 Selecting Global Tracking Fields

Figure 4.3 Selecting Global Tracking Fields

On the Global Tracking tab, the tree view on the left is populated with schema information from the document specification referenced on the General tab.To select a particular field for tracking, perform the following steps:

1. Click the field you want to track in the tree view on the left (note that it must be a leaf node).

2. Click the button corresponding to the desired data type. (Note that you are not specifically required to use strict data typing, but if you plan to use this information in business calculations later, it is wise to do so.)

The chosen fields appear on the right, denoted by their data type and an XPath expression specifying where to find the field in the source document. In this example, we have specified two fields from the document to track: the "Date" and "Number" fields from the "InvoiceHeader" record. After this document definition is saved and subsequently referenced from one or more channels, any documents that reference this document definition will have these fields logged in the SQL Server tracking database.


Channel configuration gives you the option of tracking documents at the field level. These settings override any settings specified in your referenced document definition and are used in place of the fields in your document definition.

Was this article helpful?

0 0

Post a comment