Export (0) Print
Expand All

SqlTrackingWorkflowInstance Class

Provides access to tracking data maintained in a SQL database by the SqlTrackingService for a workflow instance.

Namespace:  System.Workflow.Runtime.Tracking
Assembly:  System.Workflow.Runtime (in System.Workflow.Runtime.dll)

public class SqlTrackingWorkflowInstance

SqlTrackingWorkflowInstance objects are returned by a call to both SqlTrackingQuery.TryGetWorkflow and SqlTrackingQuery.GetWorkflows and provide access to the tracking data maintained in a SQL database by the SqlTrackingService for a specific workflow instance. The SqlTrackingWorkflowInstance class optimizes its access to the database for its properties, which maintain collections. For more information, see Refresh.

The following code example shows how to obtain information about all SqlTrackingWorkflowInstance objects contained in a list of displayed workflows. The code creates a ListViewItem for each SqlTrackingWorkflowInstance found in a displayedWorkflows variable. Each ListViewItem contains a string representation of the WorkflowInstanceInternalId, the WorkflowType and Status properties. It then adds the item to a workflowStatusList. The code uses the previously named property values and a string version of the Initialized property to create a new WorkflowStatusInfo object that is also added to the workflowStatusList.

This code example is part of the Workflow Monitor SDK Sample from the Mainform.cs file. For more information, see Workflow Monitor.

// For every workflow instance create a new WorkflowStatusInfo object and store in the workflowStatusList 
// Also populate the workflow ListView 
foreach (SqlTrackingWorkflowInstance sqlTrackingWorkflowInstance in displayedWorkflows)
{
    ListViewItem listViewItem = new ListViewItem(new string[] {
            sqlTrackingWorkflowInstance.WorkflowInstanceInternalId.ToString(),
            sqlTrackingWorkflowInstance.WorkflowType.ToString(),
            sqlTrackingWorkflowInstance.Status.ToString()}, -1);

    listViewWorkflows.Items.Add(listViewItem);

    workflowStatusList.Add(sqlTrackingWorkflowInstance.WorkflowInstanceInternalId.ToString(),
            new WorkflowStatusInfo(
                sqlTrackingWorkflowInstance.WorkflowInstanceInternalId.ToString(),
                sqlTrackingWorkflowInstance.WorkflowType.ToString(),
                sqlTrackingWorkflowInstance.Status.ToString(),
                sqlTrackingWorkflowInstance.Initialized.ToString(),
                sqlTrackingWorkflowInstance.WorkflowInstanceId,
                listViewItem));
}

System.Object
  System.Workflow.Runtime.Tracking.SqlTrackingWorkflowInstance

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

ADD
Show:
© 2014 Microsoft