Creating FileTrackingParticipant
We may want to create our own tracking participant and store tracking information in a text file. In this task, we are going to create such a tracking participant.
How to do it...
Create a workflow project:
Create a new Workflow Console Application under the solution
Chapter06
and name the projectCreatingFileTrackingParticipant
.Author a workflow:
Open the
Workflow1.xaml
file, which is created by default, and create an extremely simple workflow just for tracking.Create a custom tracking participant —FileTrackingParticipant.cs:
Now, create a class file and name it
FileTrackingParticipant.cs
containing the following codeusing System.Activities.Tracking; using System; using System.IO; namespace FileTrackingParticipant { public class FileTrackingParticipant:TrackingParticipant { string fileName; protected override void Track(TrackingRecord record, TimeSpan timeout) { fileName = @"c:\"...