Export (0) Print
Expand All

SqlTrackingWorkflowInstance.Status Property

Gets the status of the workflow instance.

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

public WorkflowStatus Status { get; set; }
/** @property */
public WorkflowStatus get_Status ()

/** @property */
public void set_Status (WorkflowStatus value)

public function get Status () : WorkflowStatus

public function set Status (value : WorkflowStatus)

Not applicable.

Property Value

A WorkflowStatus that represents the current status of the workflow instance.

Status is determined based on the tracking data for the workflow instance, specifically on the workflow tracking records sent by the runtime tracking infrastructure; therefore Status depends, in part, on the WorkflowTrackPoint objects in the TrackingProfile for the workflow instance. WorkflowTrackingRecord.TrackingWorkflowEvent in each WorkflowTrackingRecord maps to one of the WorkflowStatus values. If no workflow tracking records have been sent by the runtime tracking infrastructure for this workflow instance, Status is Created.

The following code example demonstrates how you can 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));
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft