Skip to main content
.NET Framework Class Library
SqlTrackingQuery..::.TryGetWorkflow Method

Tries to get query data for a specified workflow instance.

Namespace: System.Workflow.Runtime.Tracking
Assembly: System.Workflow.Runtime (in System.Workflow.Runtime.dll)
Syntax
Public Function TryGetWorkflow ( _
	workflowInstanceId As Guid, _
	<OutAttribute> ByRef workflowInstance As SqlTrackingWorkflowInstance _
) As Boolean
public bool TryGetWorkflow(
	Guid workflowInstanceId,
	out SqlTrackingWorkflowInstance workflowInstance
)
public:
bool TryGetWorkflow(
	Guid workflowInstanceId, 
	[OutAttribute] SqlTrackingWorkflowInstance^% workflowInstance
)
member TryGetWorkflow : 
        workflowInstanceId:Guid * 
        workflowInstance:SqlTrackingWorkflowInstance byref -> bool 

Parameters

workflowInstanceId
Type: System..::.Guid
The Guid of the workflow instance for which the tracking data is requested.
workflowInstance
Type: System.Workflow.Runtime.Tracking..::.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.

Return Value

Type: System..::.Boolean
true if tracking data is available for the requested workflow instance; otherwise, false.
Exceptions
ExceptionCondition
InvalidOperationException

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.


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


internal bool TryGetWorkflow(Guid workflowInstanceId, out SqlTrackingWorkflowInstance sqlTrackingWorkflowInstance)
{
    SqlTrackingQuery sqlTrackingQuery = new SqlTrackingQuery(connectionString);
    return sqlTrackingQuery.TryGetWorkflow(workflowInstanceId, out sqlTrackingWorkflowInstance);
}

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0
.NET Framework Security
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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