image

In Chapter 3, you learned about the four roles on a BizTalk project: business analyst, developer, system administrator, and data consumer. Chapter 5 covered the business analyst role, and showed you how to create an observation model that describes the data to be collected from a BizTalk application. This chapter describes a developer tool: the Tracking Profile Editor (TPE). The TPE is a graphical tool used to specify the messages, ports, and orchestration shapes that are the source of the data captured by BAM. In this chapter, you will learn to use the TPE to connect the observation model to a BizTalk application.

You can think of this process as specifying the implementation detail behind the abstract data model created by the business analyst. The output from this process is a tracking profile that specifies how data is captured from the BizTalk application.

Typically, the TPE will be used on a development server to build the tracking profile. Once the tracking profile has been applied and tested on the development server, it will usually be saved as a file with a .btt extension. The tracking profile file will then be transferred to the staging and production servers where it will be applied with a command-line tool called bttdeploy.

ImagesNote The TPE is only used when capturing data from BizTalk applications. It’s not used when capturing other types of data such as WCF or WF, where interceptor configuration files are used instead.

Using the TPE is a fairly simple process based on click and drag. Normally, the TPE is used by a developer who is familiar with the details of the BizTalk application. In this chapter, you’ll learn how to use TPE by working through several exercises. The exercises will involve

  • Reviewing the sample BizTalk application
  • Using the TPE to capture data from a BizTalk orchestration
  • Using the TPE to capture data from BizTalk Messaging
  • Using the TPE to set up a continuation
  • Using bttdeploy to apply a tracking profile

TPE Overview

The TPE window has two panes, a BAM activity pane and a data source pane (see Figure 6-1). The BAM activity pane on the left-hand side of the screen contains a list of all the items in an activity. The data source pane contains data items, such as orchestrations or message schemas. To specify that a particular activity field contains a specific item, you drag that item from the data source to the activity item. In Figure 6-1, each of the fields in the activity has been associated with a data item.

images

Figure 6‑1. The Tracking Profile Editor

The following data source types can be displayed in the TPE:

  • Orchestrations: Displays the flowchart associated with an orchestration.
  • Message payload schemas: Displays a message schema.
  • Context property schemas: Displays either a custom property schema that you create in Visual Studio or a standard set of context properties such as the SMTP context properties associated with the SMTP adapter.
  • Message property schema: Displays a standard set of message properties: Service ID, Instance ID, Message ID, Service Class ID, Interchange ID, Session ID, Port Start Time, Port End Time, Size, and Part Count. These properties may not be available for every shape in an orchestration. As an example, if an orchestration doesn’t contain any receive or send shapes, Message ID will never be populated. Message ID is guaranteed to exist for any receive or send shapes. If there is an error in a pipeline, Port Start Time and Port End Time will not be tracked for that interchange.

When an orchestration is displayed in the TPE, you can drag a shape from the orchestration to a milestone in the activity. This indicates that the date and time when the orchestration shape is executed should be stored in the milestone.

When a schema, context property list, or message property list is displayed in the TPE, you can drag a field from the schema or list to a business data item in the activity. As an example, if you have an integer in your message schema, you can drag it to a field in the activity of type integer.

When you capture milestone data from an orchestration, it’s easy for BizTalk to decide when to capture the milestone. Each instance of the orchestration creates a new instance of the activity. However, when you capture message payload information from a schema, you may need to provide additional guidance about when to capture the data.

You can open a schema in the TPE in two ways: selecting the payload from an orchestration shape or opening a schema directly. If you open a schema by right-clicking a shape in the orchestration and selecting Message Payload Schema, Context Property Schema, or Message Property Schema, the TPE remembers the shape associated with the schema, and captures data when the shape is executed. However, you can also open a schema directly. In that case, after you set the message element or property associated with an activity field, you need to right-click the data item, select Set Port Mappings, and then specify the BizTalk port where the data will be captured. This allows the TPE to be used in messaging applications that don’t have orchestrations, by picking the data item to capture from a message schema and then setting the receive or send port where that data item will be captured.

Several node types can be displayed in the left-hand pane of the TPE:

  • Activity and activity ID nodes: The activity ID node contains the activity ID, which is a unique identifier associated with an instance of the activity. Most of the time, you will want to leave this node empty, and BAM will automatically generate a globally unique identifier (GUID). If your data contains a unique ID such as an order number or Social Security number, you can associate this with the activity ID instead.
  • Data item nodes: In a typical tracking profile, the majority of the nodes are data item nodes. These represent the business data items in the activity, which will be captured from message payload schemas, context property schemas, or the message property schema. As an example, you will use this node type in Exercise 6-2 to capture the agent number and order number fields. These nodes are created by the business analyst in Excel or ODBA. If you connect several data items to an activity field, and more than one is processed, the last data item captured will be stored in the activity.
  • Business event nodes: The second most common node type, these nodes represent the business milestones that will be captured from the date and time an orchestration shape is executed. As an example, you will use this node type in Exercise 6-2 to capture the date and time a new order was received. These nodes are created by the business analyst in Excel or ODBA. The time recorded for a shape is the time that the shape completes execution. If an expression shape calls a method that takes time to run, the event won’t be recorded in BAM until the expression completes.
  • Continuation and continuation ID nodes: Continuations are use to capture data from two different business processes or interchanges in a single activity. As an example, imagine that your process sends out a purchase order in an orchestration, but then receives a purchase order acknowledgement from your vendor in a different orchestration. If you want to see data from both the order and acknowledgment in a single activity, you will use a BAM continuation to correlate the two. Continuations aren’t created in Excel or ODBA, they are implemented by the developer in the TPE.

    ImagesNote Exercise 6-2 contains an example of a continuation.

  • Relationship nodes: Relationships are used when an activity definition file contains more than one activity. As an example, imagine an organization that takes orders for custom manufactured parts. The business process for manufacturing each part is managed by an orchestration, and a BAM activity tracks information about each part. However, there’s also an activity that contains information about the activity as a whole. The relationship between the order header activity and the order line item activity resembles a foreign key relationship in a database. In BAM, this is implemented using relationship folders.

    ImagesNote Chapter 12 describes relationships in BAM.

  • Document reference URL nodes: The WSS, File, and FTP adapters provide a property called MessageRefURL that contains the URL of the file. Document reference URL nodes can be used to capture that property. In this case, the BAM portal will display a link to the document.

EXERCISE 6-1. REVIEWING THE SAMPLE APPLICATION

EXERCISE 6-2. USING THE TPE TO CAPTURE DATA FROM THE SAMPLE

EXERCISE 6-3. RECOVERING A TRACKING PROFILE

EXERCISE 6-4. TESTING THE APPLICATION

Applying a Tracking Profile in Production

Once you have tested a tracking profile on your development server, you will need to apply it in production. The bttdeploy utility is used to apply a tracking profile on a production server. The syntax for this command-line utility is quite simple:

bttdeploy.exe [options] <profile name>

Table 6-6 lists a couple options for bttdeploy.

images

Here are some examples of valid calls to bttdeploy:

bttdeploy myprofile.btt
bttdeploy /remove myprofile.btt
bttdeploy /mgdb MYSERVER,1433BIZTALKMGMTDB myprofile.btt

EXERCISE 6-5. APPLYING A TRACKING PROFILE IN PRODUCTION

Cleaning Up with TP

This section contains a few tips and tricks for working with tracking profiles.

Limitations of TPE

The most important limitation of TPE is that it can only be used to capture data from BizTalk artifacts. If you want to use BAM to capture data from custom code, you’ll need to use the BAM API.

ImagesNote Chapter 10 covers the BAM API.

Some messages and elements can’t be tracked with TPE. You can only track messages that have a schema that is known at design time, so you can’t track messages of type string or System.XML.XMLDocument. Also, you can’t capture data from repeated fields. As an example, if you have a purchase order message that contains multiple line items, you can capture data from the purchase order header, because each of those fields are unique, but you can’t capture data from the line items, as they are repeated fields and there is no way to tell the TPE which instance to choose.

Some limitations exist on the length of data item names. The combined length of a folder name and data item instance value cannot be longer than 128 characters.

You also can’t track any of the following orchestration shapes:

  • Group (Task)
  • Loop (While)
  • Message Assignment
  • Suspend
  • Terminate
  • Throw Exception
  • Transform

You can work around this for some shapes by wrapping them in a nontransactional scope shape and tracking the scope, but this doesn’t work for the Suspend and Terminate shapes, as they never fire the Shape End event.

Tracking Profile Storage

The TPE uses the databases listed in Table 6-7.

images

BM can’t show a list of currently applied tracking profiles. If you need to know the profiles that are applied on your server, query the bam_TrackingProfiles table in BizTalkMgmtDB.

When you apply a new version of a tracking profile, the previous version is also kept because existing instances of orchestrations may be using an older version of the tracking profile. New instances of the orchestration will always use the latest version. To remove older versions of the tracking profile, remove and then reapply the profile using either bttdeploy or TPE.

Summary

The Tracking Profile Editor is used to capture data from BizTalk messages or orchestrations. In this chapter, you learned about the different data sources and node types supported by the TPE. You did several exercises. In the first exercise, you examined the AWO sample application. In the second exercise, you built a tracking profile for the sample application. The tracking profile used a continuation to correlate messages flowing through two different BizTalk applications. In other exercises, you tested the AWO sample application, learned to recover a tracking profile using the TPE, and learned to deploy tracking profiles in production using bttdeploy.

The final chapter in Part 2 is Chapter 7, where you’ll learn to display the data using the BAM Portal, Microsoft Excel, and data-access technologies.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.89.183