Export (0) Print
Expand All

TrackingProfile.ActivityTrackPoints Property

Gets the collection of activity track points used by the runtime tracking infrastructure to filter activity status events.

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

public ActivityTrackPointCollection ActivityTrackPoints { get; }
/** @property */
public ActivityTrackPointCollection get_ActivityTrackPoints ()

public function get ActivityTrackPoints () : ActivityTrackPointCollection

Not applicable.

Property Value

An ActivityTrackPointCollection that specifies the points in a workflow instance for which the runtime tracking infrastructure should send an ActivityTrackingRecord to the tracking service.

A workflow instance emits activity status events to the runtime tracking infrastructure whenever the ActivityExecutionStatus of an activity instance changes. The runtime tracking infrastructure uses the ActivityTrackPoints property to filter these activity status events to determine when to send an ActivityTrackingRecord to the tracking service. You can add an ActivityTrackPoint to the ActivityTrackPoints property to specify points of interest in the potential execution path of the workflow instance for which you want the runtime infrastructure to send an ActivityTrackingRecord.

An ActivityTrackPoint does not actually define a physical point in a workflow instance, but instead defines a set of match parameters that can be used by the runtime tracking infrastructure to match an activity status event for which it should send an ActivityTrackingRecord. Therefore, the same ActivityTrackPoint can be matched many times during the lifespan of a workflow instance. An ActivityTrackPoint can also specify data to be extracted from the workflow instance and returned in the ActivityTrackingRecord.

The following code example demonstrates how you can create a TrackingProfile using the TrackingProfile constructor and use the object's properties to help track the execution of a workflow. The example code uses the ActivityTrackPoints, Version, and WorkflowTrackPoints properties.

This code example is part of the Query using SQLTrackingService SDK sample from the Program.cs file. For more information, see Query Using SQLTrackingService.

private static void CreateAndInsertTrackingProfile()
{
    TrackingProfile profile = new TrackingProfile();
    ActivityTrackPoint activityTrack = new ActivityTrackPoint();
    ActivityTrackingLocation activityLocation = new ActivityTrackingLocation(typeof(Activity));
    activityLocation.MatchDerivedTypes = true;
    IEnumerable<ActivityExecutionStatus> statuses = Enum.GetValues(typeof(ActivityExecutionStatus)) as IEnumerable<ActivityExecutionStatus>;
    foreach (ActivityExecutionStatus status in statuses)
    {
        activityLocation.ExecutionStatusEvents.Add(status);
    }

    activityTrack.MatchingLocations.Add(activityLocation);
    profile.ActivityTrackPoints.Add(activityTrack);
    profile.Version = version;

    WorkflowTrackPoint workflowTrack = new WorkflowTrackPoint();
    WorkflowTrackingLocation workflowLocation = new WorkflowTrackingLocation();
    IEnumerable<TrackingWorkflowEvent> eventStatuses = Enum.GetValues(typeof(TrackingWorkflowEvent)) as IEnumerable<TrackingWorkflowEvent>;
    foreach (TrackingWorkflowEvent status in eventStatuses)
    {
        workflowLocation.Events.Add(status);
    }
    
    workflowTrack.MatchingLocation = workflowLocation;
    profile.WorkflowTrackPoints.Add(workflowTrack);

    TrackingProfileSerializer serializer = new TrackingProfileSerializer();
    StringWriter writer = new StringWriter(new StringBuilder(),CultureInfo.InvariantCulture);
    serializer.Serialize(writer, profile);
    String trackingprofile = writer.ToString();
    InsertTrackingProfile(trackingprofile);
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft