This documentation is archived and is not being maintained.

TrackingService Class

The abstract base class that provides the basic interface between a tracking service and the run-time tracking infrastructure.

Namespace:  System.Workflow.Runtime.Tracking
Assembly:  System.Workflow.Runtime (in System.Workflow.Runtime.dll)

public abstract class TrackingService : WorkflowRuntimeService

A tracking service is responsible for supplying tracking channels and tracking profiles to the workflow run-time engine. The workflow run-time engine requests one TrackingChannel from a tracking service for each workflow instance for which it has a TrackingProfile. The workflow run-time engine uses this TrackingChannel to send tracking records associated with that workflow instance. A TrackingProfile contains track points that specify a set of tracking events for which the run-time tracking infrastructure should send tracking records. A TrackingProfile may also specify data to be extracted from the workflow instance when one of these tracking events occurs.

The run-time tracking infrastructure uses a TrackingProfile to filter tracking events emitted by a workflow instance. When a tracking event is emitted that matches a track point in the TrackingProfile, the run-time tracking infrastructure extracts any data specified in the TrackingProfile from the workflow instance and encapsulates this data and information about the tracking event in a tracking record. This tracking record is then sent over the TrackingChannel associated with the workflow instance. A tracking record may be one of the following kinds:




The host application can use the tracking record in any way that it chooses. For example, the host application may store the tracking information in a database and use it to implement a sophisticated user interface, or it may use the information to inform an administrator of a condition that requires some action. You can register a tracking service with the workflow run-time engine by calling WorkflowRuntime.AddService or by including the appropriate entry in the application configuration file.

All tracking services must inherit from the TrackingService abstract class. This class defines the basic interface between a tracking service and the run-time tracking infrastructure. The workflow run-time engine requests a TrackingProfile for a specific workflow instance or workflow Type by calling one of the overloaded GetProfile methods or the TryGetProfile method. The workflow run-time engine calls GetTrackingChannel to request a TrackingChannel.

The workflow tracking runtime calls the GetProfile and TryGetProfile methods whenever a workflow instance is created or loaded from the persistence store. The overhead associated with these calls can be costly to the tracking service (many database calls, for example). You can implement the IProfileNotification interface in your tracking service to circumvent this call-based mechanism and use events to notify the workflow runtime engine of changes to a TrackingProfile. For tracking services that implement the IProfileNotification interface, the workflow run-time engine subscribes to the ProfileUpdated and ProfileRemoved events. Your tracking service can raise the appropriate event when a change to one of its tracking profiles occurs. The SqlTrackingService class implements this interface.

The workflow run-time engine calls the TryReloadProfile method to test whether a TrackingProfile has been updated or removed as a result of an explicit call by a host or a service to ReloadTrackingProfiles on a workflow instance. This process enables a host or service to dynamically change the tracking profile that is being used for a specific workflow instance.

Notes to Inheritors:

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0