I'll add the tracking service for the reimbursement multilevel Approval workflow project in asp.net.
The SqlTrackingService class represents a fully functional tracking service. Use this service to collect and store trace information, to store trace profiles, and to provide these when the workflow runtime engine requests it. The SQL Tracking service writes the trace data sent to it by the Run-time tracking infrastructure to the SQL database. In many cases, it is important for the SqlTrackingService service to maintain consistency between its database and the runtime engine state of the workflow. Therefore, the SqlTrackingService class implements the IPendingWork interface and can participate in the Workflow transaction batch functionality provided by the WorkflowCommitWorkBatchService service. You can set the IsTransactional property, or pass the appropriate arguments to the constructor, to configure the SqlTrackingService service to participate in the batch, and to add the object that represents the SQL database pending changes to the work batch.
The SqlTrackingService service also retains the tracking configuration file in its database. The workflow runtime engine knows the changes made to any of the tracking profiles that are used. The SqlTrackingService service implements the Iprofilenotification interface and periodically checks the trace configuration file in its database to notify the workflow runtime engine of changes made to the trackingprofile stored in its database. You can set the Profilechangecheckinterval property or pass the appropriate parameter to the constructor to set the interval, and the SqlTrackingService service will check its tracking profile at that interval. [MSDN]
First: Configure the database for tracking.
Under the C:\WINDOWS\Microsoft.NET\Framework\v3.0\Windows Workflow foundation\sql\en directory, there are two files Tracking_schema.sql and Tracking_ Logic.sql, Ann successively executes the order.
Second: Configure tracking service. The configuration file is as follows:
<?xml version= "1.0" encoding= "Utf-8"?>
<configuration>
<configSections>
< Section name= "workflowwithtracking"
type= "System.Workflow.Runtime.Configuration.WorkflowRuntimeSection,
System.Workflow.Runtime, version=3.0.00000.0, Culture=neutral,
Publickeytoken=31bf3856ad364e35 "/>
</configSections>
<WorkflowWithTracking>
< commonparameters>
<add name= "ConnectionString"
value= "Data source=.;i Nitial catalog=c6ps;integrated security=true "/>
</CommonParameters>
<Services>
; add Type= "System.Workflow.Runtime.Tracking.SqlTrackingService,
System.Workflow.Runtime, version= 3.0.00000.0,
culture=neutral,publickeytoken=31bf3856ad364e35 "/>
</Services>
</ Workflowwithtracking>
</configuration>