Tries to get query data for a specified workflow instance.
Assembly: System.Workflow.Runtime (in System.Workflow.Runtime.dll)
Syntax . . :: . Boolean
true if tracking data is available for the requested workflow instance; otherwise, false.
Public Function TryGetWorkflow ( _
workflowInstanceId As Guid, _
<OutAttribute> ByRef workflowInstance As SqlTrackingWorkflowInstance _
) As Booleanpublic 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: Systemtrue if tracking data is available for the requested workflow instance; otherwise, false.
Exceptions
| Exception | Condition |
|---|---|
| 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);
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
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. See Also