/// <summary> /// Creates and saves a default tracking profile /// </summary> /// <returns></returns> private TrackingProfile BuildDefaultProfile() { //return a default profile that tracks all possible //workflow events and activity status values TrackingProfile profile = new TrackingProfile(); // //create a workflow track point and location // WorkflowTrackPoint workflowPoint = new WorkflowTrackPoint(); //add all possible workflow events List <TrackingWorkflowEvent> workflowEvents = new List <TrackingWorkflowEvent>(); workflowEvents.AddRange( Enum.GetValues(typeof(TrackingWorkflowEvent)) as IEnumerable <TrackingWorkflowEvent>); WorkflowTrackingLocation workflowLocation = new WorkflowTrackingLocation(workflowEvents); workflowPoint.MatchingLocation = workflowLocation; profile.WorkflowTrackPoints.Add(workflowPoint); // //create an activity track point and location // ActivityTrackPoint activityPoint = new ActivityTrackPoint(); //add all possible activity execution status values List <ActivityExecutionStatus> activityStatus = new List <ActivityExecutionStatus>(); activityStatus.AddRange( Enum.GetValues(typeof(ActivityExecutionStatus)) as IEnumerable <ActivityExecutionStatus>); ActivityTrackingLocation activityLocation = new ActivityTrackingLocation( typeof(Activity), true, activityStatus); activityPoint.MatchingLocations.Add(activityLocation); profile.ActivityTrackPoints.Add(activityPoint); // //create a user track point and location // UserTrackPoint userPoint = new UserTrackPoint(); UserTrackingLocation userLocation = new UserTrackingLocation( typeof(Object), typeof(Activity)); userLocation.MatchDerivedActivityTypes = true; userLocation.MatchDerivedArgumentTypes = true; userPoint.MatchingLocations.Add(userLocation); profile.UserTrackPoints.Add(userPoint); //set the profile version profile.Version = new Version(1, 0, 0); return(profile); }
internal 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); }
/// <summary> /// Toggles whether the specified member is extracted /// </summary> /// <param name="activity"></param> /// <param name="activityExtract">True if this is an activity extract, false if this is a workflow extract</param> /// <param name="member"></param> internal void ToggleExtract(Activity activity, bool activityExtract, string member) { ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity); if (trackPoint != null) { bool removed = false; for (int i = trackPoint.Extracts.Count - 1; i > 0; i--) { if (trackPoint.Extracts[i].Member == member) { trackPoint.Extracts.Remove(trackPoint.Extracts[i]); removed = true; } } if (!removed) { if (activityExtract) { trackPoint.Extracts.Add(new ActivityDataTrackingExtract(member)); } else { trackPoint.Extracts.Add(new WorkflowDataTrackingExtract(member)); } } } }
/// <summary> /// Deletes a tracking condition for an activity /// </summary> /// <param name="activity"></param> /// <param name="condition"></param> internal void DeleteTrackingCondition(Activity activity, ActivityTrackingCondition condition) { ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity); if (trackPoint != null) { trackPoint.MatchingLocations[0].Conditions.Remove(condition); } }
private void matchDerivedTypes_Click(object sender, EventArgs e) { ActivityTrackPoint trackPoint = profileManager.GetTrackPointForActivity(SelectedActivity); if (trackPoint != null && trackPoint.MatchingLocations.Count > 0) { matchDerivedTypes.Checked = trackPoint.MatchingLocations[0].MatchDerivedTypes = !trackPoint.MatchingLocations[0].MatchDerivedTypes; RefreshView(); } }
/// <summary> /// Gets the annotation for an activity. If no annotation is present, null is returned. /// </summary> /// <param name="activity"></param> /// <returns></returns> public string GetAnnotation(Activity activity) { ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity); if (trackPoint != null && trackPoint.Annotations.Count > 0) { return(trackPoint.Annotations[0]); } else { return(null); } }
/// <summary> /// Gets the conditions for an activity /// </summary> /// <param name="activity"></param> /// <returns></returns> internal TrackingConditionCollection GetTrackingConditions(Activity activity) { ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity); if (trackPoint != null) { return(trackPoint.MatchingLocations[0].Conditions); } else { return(null); } }
/// <summary> /// Sets the annotaiton for an activity or workflow trackpoint /// </summary> /// <param name="activity"></param> /// <param name="annotation"></param> public void SetAnnotation(Activity activity, string annotation) { ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity); if (trackPoint != null && trackPoint.Annotations.Count > 0) { trackPoint.Annotations[0] = annotation; } else { trackPoint.Annotations.Add(annotation); } }
private static void CreateAndInsertTrackingProfile() { TrackingProfile profile = new TrackingProfile(); // Create an activity track point, used for tracking data from Code Activities. ActivityTrackPoint codeActivityTrackPoint = new ActivityTrackPoint(); // Create an ActivityTrackingLocation to be added to the track point. ActivityTrackingLocation codeActivityTrackingLocation = new ActivityTrackingLocation("CodeActivity"); codeActivityTrackingLocation.MatchDerivedTypes = true; // Add the location "Closed" event to track. codeActivityTrackingLocation.ExecutionStatusEvents.Add(ActivityExecutionStatus.Closed); codeActivityTrackPoint.MatchingLocations.Add(codeActivityTrackingLocation); // Create a WorkflowDataTrackingExtract for extracting data from the Balance property. WorkflowDataTrackingExtract balanceWorkflowTrackingExtract = new WorkflowDataTrackingExtract(); balanceWorkflowTrackingExtract.Member = "Balance"; // Create an activity track point, used for tracking data in the custom activity "ServiceCharge". ActivityTrackPoint customActivityTrackPoint = new ActivityTrackPoint(); ActivityTrackingLocation customActivityTrackingLocation = new ActivityTrackingLocation("ServiceCharge"); // Create an ActivityTrackingLocation to be added to the track point customActivityTrackingLocation.ExecutionStatusEvents.Add(ActivityExecutionStatus.Closed); customActivityTrackPoint.MatchingLocations.Add(customActivityTrackingLocation); // Create an ActivityDataTrackingExtract for extracting Fee property data from the ServiceCharge activity. ActivityDataTrackingExtract feeActivityTrackingExtract = new ActivityDataTrackingExtract(); feeActivityTrackingExtract.Member = "Fee"; // Add extracts to the activity tracking points. codeActivityTrackPoint.Extracts.Add(balanceWorkflowTrackingExtract); customActivityTrackPoint.Extracts.Add(feeActivityTrackingExtract); profile.ActivityTrackPoints.Add(codeActivityTrackPoint); profile.ActivityTrackPoints.Add(customActivityTrackPoint); profile.Version = new Version("3.0.0.0"); // Serialize the profile. TrackingProfileSerializer serializer = new TrackingProfileSerializer(); StringWriter writer = new StringWriter(new StringBuilder(), CultureInfo.InvariantCulture); serializer.Serialize(writer, profile); String trackingprofile = writer.ToString(); InsertTrackingProfile(trackingprofile); }
internal ActivityTrackPointCacheItem(ActivityTrackPoint point, List <ActivityExecutionStatus> events, bool hasConditions) { if (point == null) { throw new ArgumentNullException("point"); } if (events == null) { throw new ArgumentNullException("events"); } this.Point = point; this.Events = events; this.HasLocationConditions = hasConditions; }
/// <summary> /// Loads create a Default profile /// </summary> /// <returns></returns> private static TrackingProfile GetDefaultProfile(Type workflowType) { TrackingProfile profile = new TrackingProfile(); profile.Version = new Version(1, 0, 0, 0); // all activity events ActivityTrackPoint atp = new ActivityTrackPoint(); List <ActivityExecutionStatus> executionStatusLists = new List <ActivityExecutionStatus>(); foreach (ActivityExecutionStatus status in Enum.GetValues(typeof(ActivityExecutionStatus))) { executionStatusLists.Add(status); } ActivityTrackingLocation activityTrackingLocation = new ActivityTrackingLocation(typeof(Activity), true, executionStatusLists); atp.MatchingLocations.Add(activityTrackingLocation); WorkflowDataTrackingExtract we = new WorkflowDataTrackingExtract("SetupId"); atp.Extracts.Add(we); profile.ActivityTrackPoints.Add(atp); // all user TrackData events UserTrackPoint utp = new UserTrackPoint(); UserTrackingLocation userTrackingLocation = new UserTrackingLocation(); userTrackingLocation.ActivityType = typeof(Activity); //userTrackingLocation.MatchDerivedActivityTypes = true; userTrackingLocation.ArgumentType = typeof(object); //userTrackingLocation.MatchDerivedArgumentTypes = true; utp.MatchingLocations.Add(userTrackingLocation); profile.UserTrackPoints.Add(utp); // all workflow events WorkflowTrackPoint wftp = new WorkflowTrackPoint(); foreach (TrackingWorkflowEvent evt in Enum.GetValues(typeof(TrackingWorkflowEvent))) { wftp.MatchingLocation.Events.Add(evt); } profile.WorkflowTrackPoints.Add(wftp); return(profile); }
internal ActivityTrackPointCacheItem(ActivityTrackPoint point, List <ActivityExecutionStatus> events, bool hasConditions) { if (null == point) { throw new ArgumentNullException("point"); } if (null == events) { throw new ArgumentNullException("events"); } Point = point; Events = events; HasLocationConditions = hasConditions; }
/// <summary> /// Saves a tracking condition for an activity /// </summary> /// <param name="activity"></param> /// <param name="key"></param> /// <param name="member"></param> /// <param name="op"></param> /// <param name="value"></param> internal void SaveTrackingCondition(Activity activity, ref ActivityTrackingCondition key, string member, ComparisonOperator op, string value) { ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity); if (trackPoint != null) { if (key == null) { key = new ActivityTrackingCondition(); trackPoint.MatchingLocations[0].Conditions.Add(key); } key.Member = member; key.Value = value; key.Operator = op; } }
/// <summary> /// Returns an error message if the specified activity's track point is not correctly configured /// </summary> /// <param name="activity"></param> /// <returns></returns> internal bool IsActivityValid(Activity activity, out string errorMessage) { ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity); if (trackPoint != null) { if (trackPoint.MatchingLocations.Count == 0 || trackPoint.MatchingLocations[0].ExecutionStatusEvents.Count == 0) { errorMessage = "Need at least one status event"; return(true); } } errorMessage = string.Empty; return(false); }
/// <summary> /// Toggles whether the specified activity status is tracked /// </summary> /// <param name="activity"></param> /// <param name="status"></param> internal void ToggleEventStatus(Activity activity, ActivityExecutionStatus status) { ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity); if (trackPoint != null) { if (trackPoint.MatchingLocations[0].ExecutionStatusEvents.Contains(status)) { trackPoint.MatchingLocations[0].ExecutionStatusEvents.Remove(status); } else { trackPoint.MatchingLocations[0].ExecutionStatusEvents.Add(status); } } }
// Profile creation private static TrackingProfile GetProfile() { // Create a Tracking Profile TrackingProfile profile = new TrackingProfile(); profile.Version = new Version("3.0.0"); // Add a TrackPoint to cover all activity status events ActivityTrackPoint activityTrackPoint = new ActivityTrackPoint(); ActivityTrackingLocation activityLocation = new ActivityTrackingLocation(typeof(Activity)); activityLocation.MatchDerivedTypes = true; WorkflowTrackingLocation wLocation = new WorkflowTrackingLocation(); IEnumerable <ActivityExecutionStatus> statuses = Enum.GetValues(typeof(ActivityExecutionStatus)) as IEnumerable <ActivityExecutionStatus>; foreach (ActivityExecutionStatus status in statuses) { activityLocation.ExecutionStatusEvents.Add(status); } activityTrackPoint.MatchingLocations.Add(activityLocation); profile.ActivityTrackPoints.Add(activityTrackPoint); // Add a TrackPoint to cover all workflow status events WorkflowTrackPoint workflowTrackPoint = new WorkflowTrackPoint(); workflowTrackPoint.MatchingLocation = new WorkflowTrackingLocation(); foreach (TrackingWorkflowEvent workflowEvent in Enum.GetValues(typeof(TrackingWorkflowEvent))) { workflowTrackPoint.MatchingLocation.Events.Add(workflowEvent); } profile.WorkflowTrackPoints.Add(workflowTrackPoint); // Add a TrackPoint to cover all user track points UserTrackPoint userTrackPoint = new UserTrackPoint(); UserTrackingLocation userLocation = new UserTrackingLocation(); userLocation.ActivityType = typeof(Activity); userLocation.MatchDerivedActivityTypes = true; userLocation.ArgumentType = typeof(object); userLocation.MatchDerivedArgumentTypes = true; userTrackPoint.MatchingLocations.Add(userLocation); profile.UserTrackPoints.Add(userTrackPoint); return(profile); }
/// <summary> /// Toggles (removes or adds) a trackpoint for a given activity /// </summary> /// <param name="activity"></param> public void ToggleActivityTrackPoint(Activity activity) { ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity); //If a trackpoint is tracking this activity type, remove it if (trackPoint != null) { TrackingProfile.ActivityTrackPoints.Remove(trackPoint); } //Otherwise, add a new one else { trackPoint = new ActivityTrackPoint(); trackPoint.MatchingLocations.Add(new ActivityTrackingLocation(activity.GetType())); TrackingProfile.ActivityTrackPoints.Add(trackPoint); } }
/// <summary> /// Gets a tracking profile that tracks on every activity close /// and uses data extracts to get the workflow properties /// </summary> /// <param name="workflowType"></param> /// <returns></returns> private static TrackingProfile GetProfileCore(Type workflowType) { var profile = new TrackingProfile { Version = new Version(1, 0, 0) }; var trackPoint = new ActivityTrackPoint(); var location = new ActivityTrackingLocation(typeof(Activity), true, new[] { ActivityExecutionStatus.Closed }); trackPoint.MatchingLocations.Add(location); //get the track points for all of the public properties declared in the workflow trackPoint.Extracts.AddRange(GetWorkflowExtracts(workflowType)); profile.ActivityTrackPoints.Add(trackPoint); return(profile); }
/// <summary> /// Add a custom tracking profile for this workflow /// </summary> private static void AddCustomTrackingProfile() { //get the default profile for the workflow TrackingProfileHelper helper = new TrackingProfileHelper(_connStringTracking); TrackingProfile profile = helper.RetrieveProfile( typeof(SharedWorkflows.TrackingRulesWorkflow)); if (profile != null) { //add an activity track point that captures workflow //field values prior to the RuleSet execution ActivityTrackingLocation location = new ActivityTrackingLocation(); location.ActivityTypeName = "PolicyActivity"; location.ExecutionStatusEvents.Add( ActivityExecutionStatus.Executing); ActivityTrackPoint point = new ActivityTrackPoint(); point.Extracts.Add(new WorkflowDataTrackingExtract("field1")); point.Extracts.Add(new WorkflowDataTrackingExtract("field2")); point.Extracts.Add(new WorkflowDataTrackingExtract("field3")); point.Annotations.Add("Before RuleSet execution"); point.MatchingLocations.Add(location); profile.ActivityTrackPoints.Add(point); //extract values for the same fields after RuleSet execution location = new ActivityTrackingLocation(); location.ActivityTypeName = "PolicyActivity"; location.ExecutionStatusEvents.Add(ActivityExecutionStatus.Closed); point = new ActivityTrackPoint(); point.Extracts.Add(new WorkflowDataTrackingExtract("field1")); point.Extracts.Add(new WorkflowDataTrackingExtract("field2")); point.Extracts.Add(new WorkflowDataTrackingExtract("field3")); point.Annotations.Add("After RuleSet execution"); point.MatchingLocations.Add(location); profile.ActivityTrackPoints.Add(point); //assign a new version that +1 greater than the last profile.Version = new Version( profile.Version.Major, profile.Version.Minor + 1, 0); //apply the update to the tracking profile helper.UpdateProfile( profile, typeof(SharedWorkflows.TrackingRulesWorkflow)); } }
public void RefreshEventsDropDown() { ActivityTrackPoint trackPoint = profileManager.GetTrackPointForActivity(SelectedActivity); if (trackPoint != null) { if (trackPoint.MatchingLocations.Count > 0) { ActivityTrackingLocation atl = trackPoint.MatchingLocations[0]; foreach (ActivityExecutionStatus status in atl.ExecutionStatusEvents) { if (this.eventsDropDown.DropDownItems.ContainsKey(status.ToString())) { ((ToolStripButton)this.eventsDropDown.DropDownItems[status.ToString()]).Checked = true; } } } } }
private void CreateAndInsertTrackingProfile() { TrackingProfile profile = new TrackingProfile(); ActivityTrackPoint trackPoint = new ActivityTrackPoint(); ActivityTrackingLocation location = new ActivityTrackingLocation(typeof(Activity)); // Specify tracking locations location.MatchDerivedTypes = true; foreach (ActivityExecutionStatus status in Enum.GetValues(typeof(ActivityExecutionStatus))) { location.ExecutionStatusEvents.Add(status); } trackPoint.MatchingLocations.Add(location); // Specify workflow properties to track WorkflowDataTrackingExtract dataExtract = new WorkflowDataTrackingExtract(); dataExtract.Member = "UserId"; trackPoint.Extracts.Add(dataExtract); dataExtract = new WorkflowDataTrackingExtract(); dataExtract.Member = "SessionId"; trackPoint.Extracts.Add(dataExtract); dataExtract = new WorkflowDataTrackingExtract(); dataExtract.Member = "RegistrationStatus"; trackPoint.Extracts.Add(dataExtract); // Update profile profile.ActivityTrackPoints.Add(trackPoint); profile.Version = new Version("3.0.0.1"); // Serialize the profile TrackingProfileSerializer serializer = new TrackingProfileSerializer(); StringWriter writer = new StringWriter(new StringBuilder(), CultureInfo.InvariantCulture); serializer.Serialize(writer, profile); string trackingprofile = writer.ToString(); InsertTrackingProfile(trackingprofile); }
private static void CreateAndInsertTrackingProfile() { TrackingProfile profile = new TrackingProfile(); ActivityTrackPoint trackPoint = new ActivityTrackPoint(); ActivityTrackingLocation location = new ActivityTrackingLocation(typeof(Activity)); location.MatchDerivedTypes = true; IEnumerable <ActivityExecutionStatus> statuses = Enum.GetValues(typeof(ActivityExecutionStatus)) as IEnumerable <ActivityExecutionStatus>; foreach (ActivityExecutionStatus status in statuses) { location.ExecutionStatusEvents.Add(status); } trackPoint.MatchingLocations.Add(location); profile.ActivityTrackPoints.Add(trackPoint); profile.Version = new Version("3.0.0.0"); // Adding a user track point to the tracking profile UserTrackPoint utp = new UserTrackPoint(); // Adding a user location to the track point UserTrackingLocation ul = new UserTrackingLocation(typeof(string), typeof(CodeActivity)); ul.MatchDerivedActivityTypes = true; utp.MatchingLocations.Add(ul); profile.UserTrackPoints.Add(utp); // Serialize the profile TrackingProfileSerializer serializer = new TrackingProfileSerializer(); StringWriter writer = new StringWriter(new StringBuilder(), CultureInfo.InvariantCulture); serializer.Serialize(writer, profile); string trackingprofile = writer.ToString(); InsertTrackingProfile(trackingprofile); }
private void RefreshExtractDropDown() { this.activityMembersToolStripMenuItem.DropDown = GetExtractableMembers(SelectedActivity, OnExtractItemClicked, true, true); this.activityMembersToolStripMenuItem.Text = SelectedActivity.GetType().Name; this.workflowMembersToolStripMenuItem.DropDown = GetExtractableMembers(RootActivity, OnExtractItemClicked, true, false); //Only display both activity and workflow members if this is not the root activity; otherwise only display the activity members this.workflowMembersToolStripMenuItem.Visible = (SelectedActivity != RootActivity); ActivityTrackPoint trackPoint = profileManager.GetTrackPointForActivity(SelectedActivity); if (trackPoint != null) { foreach (TrackingExtract te in trackPoint.Extracts) { if (this.extractDropDown.DropDownItems.ContainsKey(te.Member)) { ((ToolStripButton)this.extractDropDown.DropDownItems[te.Member]).Checked = true; } } } }
/// <summary> /// Returns true if the associated trackpoint for the activity matches derived types /// </summary> /// <param name="activity"></param> /// <returns></returns> public bool MatchesDerivedTypes(Activity activity) { ActivityTrackPoint trackPoint = GetTrackPointForActivity(activity); return(trackPoint != null && trackPoint.MatchingLocations[0].MatchDerivedTypes); }
static TrackingProfile GetProfileWithWorkflowDataExtract() { //Create Tracking Profile TrackingProfile trackingProfile = new TrackingProfile(); trackingProfile.Version = new Version("1.0.0"); //Create Activity Track Point ActivityTrackPoint activityTrackPoint = new ActivityTrackPoint(); //Create matchingActivityTrackingLocation ActivityTrackingLocation matchingActivityTrackingLocation = new ActivityTrackingLocation(); //Set ActivityName = "activityName" matchingActivityTrackingLocation.ActivityTypeName = "activityName"; //Add all possible ActivityExecutionStatus to the matchingActivityTrackingLocation Events IEnumerable <ActivityExecutionStatus> statuses = Enum.GetValues(typeof(ActivityExecutionStatus)) as IEnumerable <ActivityExecutionStatus>; foreach (ActivityExecutionStatus status in statuses) { matchingActivityTrackingLocation.ExecutionStatusEvents.Add(status); } //Create matchingActivityTrackingCondition where memberName = memberValue ActivityTrackingCondition matchingActivityTrackingCondition = new ActivityTrackingCondition("memberName", "memberValue"); matchingActivityTrackingCondition.Operator = ComparisonOperator.Equals; //Add matchingActivityTrackingCondition to activityTrackingLocation matchingActivityTrackingLocation.Conditions.Add(matchingActivityTrackingCondition); //Add matchingActivityTrackingCondition to the matching locations for activityTrackPoint activityTrackPoint.MatchingLocations.Add(matchingActivityTrackingLocation); //Create excludedActivityTrackingLocation ActivityTrackingLocation excludedActivityTrackingLocation = new ActivityTrackingLocation(); //Set ActivityName = "activityName" excludedActivityTrackingLocation.ActivityTypeName = "activityName"; //Add Compensating ActivityExecutionStatus to the excludedActivityTrackingLocation Events excludedActivityTrackingLocation.ExecutionStatusEvents.Add(ActivityExecutionStatus.Compensating); //Add excludedActivityTrackingCondition to the excluded locations for activityTrackPoint activityTrackPoint.ExcludedLocations.Add(excludedActivityTrackingLocation); //Create workflowDataTrackingExtract to extract Workflow data "Name" WorkflowDataTrackingExtract workflowDataTrackingExtract = new WorkflowDataTrackingExtract(); workflowDataTrackingExtract.Member = "Name"; //Add workflowDataTrackingExtract to activityTrackPoint activityTrackPoint.Extracts.Add(workflowDataTrackingExtract); //Annotate activityTrackPoint with activityTrackPoint.Annotations.Add("Track Point Annotations"); //Add ActivityTrackPoints to trackingProfile trackingProfile.ActivityTrackPoints.Add(activityTrackPoint); return(trackingProfile); }