Termination Tracking Service Sample
Termination Tracking Service is an example of a custom tracking service. It logs the termination events and the associated terminated information in the event log. The sample contains a simple workflow with a TerminateActivity activity. The reason for termination is stated in the properties of the TerminateActivity activity. When you run the sample, you get an event log entry that states the instance ID and the reason for termination.
The Termination Tracking Service is an extension of the TrackingService class, and it uses the event log to record workflow termination events. By adding the Termination Tracking Service to the WorkflowRuntime as a service, you enable it to automatically track workflow termination events with no further configuration needed.
To build the sample
Download the sample by clicking Download Sample in this topic.
This extracts the sample project to your local hard disk.
Click Start, point to Programs, point to Microsoft Windows SDK, and then click CMD Shell.
Go to the source directory of the sample.
At the command prompt, type MSBUILD <Solution file name>.
To run the sample
- In the SDK Command Prompt window, run the .exe file in the TerminationTrackingService\bin\debug folder, which is located below the main folder for the sample.
Using the Sample
When you compile the Termination Tracking Service sample, the application is created in the TerminationTrackingService\bin\debug directory. When you run the application, check the Event Viewer to verify that the workflow termination was logged properly. The termination event is recorded to the Application log.
See Also
Other Resources
Creating Custom Tracking Services
Windows Workflow Tracking Services
Application Samples
Windows Workflow Foundation Samples
© 2007 Microsoft Corporation. All rights reserved.