SqlTrackingWorkflowInstance.Status Property

Definition

Gets the status of the workflow instance.

public System.Workflow.Runtime.WorkflowStatus Status { get; set; }

Property Value

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

Examples

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.

static void WriteTerminatedEventArgs(string eventDescription, TrackingWorkflowTerminatedEventArgs terminatedEventArgs, DateTime eventDataTime)
{
    Console.WriteLine("\nTerminated Event Arguments Read From Tracking Database:\n");
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString());
    Console.WriteLine("EventDescription: " + eventDescription);
    if (null != terminatedEventArgs.Exception)
    {
        Console.WriteLine("TerminatedEventArgs Exception Message: " + terminatedEventArgs.Exception.Message.ToString());
    }
}

Remarks

Status is determined based on the tracking data for the workflow instance, specifically on the workflow tracking records sent by the run-time 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 run-time tracking infrastructure for this workflow instance, Status is Created.

Applies to

منتج الإصدارات
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also