using System; using System.Workflow.ComponentModel; namespace Cookbook_CustomActivities_WF3 { public class MyActivity : Activity { protected override ActivityExecutionStatus Execute( ActivityExecutionContext context) { this.TrackData("Tracking something"); … } } } In WF4, custom tracking data is added to a CustomTrackingRecord and is emitted using the Track method on the activity execution context. The name of the custom tracking record, provided to the constructor, can be used to query for the record. The custom data is specified as a dictionary of <string, object> pairs within the emitted record. using System; using System.Activities; using System.Activities.Tracking; namespace Cookbook_CustomActivities_WF4 { public class MyActivity : CodeActivity { protected override void Execute(CodeActivityContext context) { CustomTrackingRecord record = new CustomTrackingRecord("CustomTracking"); record.Data.Add("CustomData", "Tracking something"); context.Track(record); … } } } Tracking Profiles In WF3, a tracking profile defines a list of "track points," which subscribe for events that will be passed on to a tracking service. A tracking profile can be created in code or read from an XML file.
using System; using System.Workflow.ComponentModel; namespace Cookbook_CustomActivities_WF3 { public class MyActivity : Activity { protected override ActivityExecutionStatus Execute( ActivityExecutionContext context) { this.TrackData("Tracking something"); … } } } In WF4, custom tracking data is added to a CustomTrackingRecord and is emitted using the Track method on the activity execution context. The name of the custom tracking record, provided to the constructor, can be used to query for the record. The custom data is specified as a dictionary of <string, object> pairs within the emitted record. using System; using System.Activities; using System.Activities.Tracking; namespace Cookbook_CustomActivities_WF4 { public class MyActivity : CodeActivity { protected override void Execute(CodeActivityContext context) { CustomTrackingRecord record = new CustomTrackingRecord("CustomTracking"); record.Data.Add("CustomData", "Tracking something"); context.Track(record); … } } } Tracking Profiles In WF3, a tracking profile defines a list of "track points," which subscribe for events that will be passed on to a tracking service. A tracking profile can be created in code or read from an XML file.