Edit

Share via


SqlTrackingQuery.TryGetWorkflow(Guid, SqlTrackingWorkflowInstance) Method

Definition

Tries to get query data for a specified workflow instance.

public:
 bool TryGetWorkflow(Guid workflowInstanceId, [Runtime::InteropServices::Out] System::Workflow::Runtime::Tracking::SqlTrackingWorkflowInstance ^ % workflowInstance);
public bool TryGetWorkflow (Guid workflowInstanceId, out System.Workflow.Runtime.Tracking.SqlTrackingWorkflowInstance workflowInstance);
member this.TryGetWorkflow : Guid * SqlTrackingWorkflowInstance -> bool
Public Function TryGetWorkflow (workflowInstanceId As Guid, ByRef workflowInstance As SqlTrackingWorkflowInstance) As Boolean

Parameters

workflowInstanceId
Guid

The Guid of the workflow instance for which the tracking data is requested.

workflowInstance
SqlTrackingWorkflowInstance

When this method returns true, contains a SqlTrackingWorkflowInstance that provides access to the tracking data associated with the workflow instance. This parameter is passed uninitiailized.

Returns

true if tracking data is available for the requested workflow instance; otherwise, false.

Exceptions

ConnectionString is a null reference (Nothing in Visual Basic).

Examples

The following code example demonstrates how to use the TryGetWorkflow method to retrieve a SqlTrackingWorkflowInstance.

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

internal bool TryGetWorkflow(Guid workflowInstanceId, out SqlTrackingWorkflowInstance sqlTrackingWorkflowInstance)
{
    SqlTrackingQuery sqlTrackingQuery = new SqlTrackingQuery(connectionString);
    return sqlTrackingQuery.TryGetWorkflow(workflowInstanceId, out sqlTrackingWorkflowInstance);
}
Friend Function TryGetWorkflow(ByVal workflowInstanceId As Guid, ByVal sqlTrackingWorkflowInstance As SqlTrackingWorkflowInstance) As Boolean
    Dim SqlTrackingQuery As New SqlTrackingQuery(connectionString)
    Return SqlTrackingQuery.TryGetWorkflow(workflowInstanceId, sqlTrackingWorkflowInstance)
End Function

Applies to

See also