Export (0) Print
Expand All

TrackingService Class

Note: This API is now obsolete.

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)

[ObsoleteAttribute("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public abstract class TrackingService : WorkflowRuntimeService

The TrackingService type exposes the following members.

  NameDescription
Protected methodTrackingServiceWhen implemented in a derived class, initializes a new instance of the TrackingService class.
Top

  NameDescription
Protected propertyRuntimeGets the WorkflowRuntime for this service. (Inherited from WorkflowRuntimeService.)
Protected propertyStateGets the state of the WorkflowRuntimeService. (Inherited from WorkflowRuntimeService.)
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Protected methodGetProfile(Guid)Must be overridden in the derived class, and when implemented, returns the tracking profile for the specified workflow instance.
Protected methodGetProfile(Type, Version)Must be overridden in the derived class, and when implemented, returns the tracking profile, qualified by version, for the specified workflow Type.
Protected methodGetTrackingChannelMust be overridden in the derived class, and when implemented, returns the channel that the run-time tracking infrastructure uses to send tracking records to the tracking service.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnStartedWhen overridden in a derived class, represents the method that will be called when the workflow runtime engine raises the WorkflowRuntime.Started event. (Inherited from WorkflowRuntimeService.)
Protected methodOnStoppedWhen overridden in a derived class, represents the method that will be called when the workflow runtime engine raises the WorkflowRuntime.Stopped event. (Inherited from WorkflowRuntimeService.)
Protected methodRaiseServicesExceptionNotHandledEventRaises the WorkflowRuntime.ServicesExceptionNotHandled event. (Inherited from WorkflowRuntimeService.)
Protected methodStartWhen overridden in a derived class, starts the service and changes the State to Starting. (Inherited from WorkflowRuntimeService.)
Protected methodStopWhen overridden in a derived class, stops the service and changes the State to Stopping. (Inherited from WorkflowRuntimeService.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Protected methodTryGetProfileMust be overridden in the derived class, and when implemented, retrieves the tracking profile for the specified workflow type if one is available.
Protected methodTryReloadProfileMust be overridden in the derived class, and when implemented, retrieves a new tracking profile for the specified workflow instance if the tracking profile has changed since it was last loaded.
Top

NoteNote

This material discusses types and namespaces that are obsolete. For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

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:

ActivityTrackingRecord

UserTrackingRecord

WorkflowTrackingRecord

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

.NET Framework

Supported in: 4, 3.5, 3.0
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.5
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5.2

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

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