SqlTrackingQuery.GetWorkflows没有获得正确的工作流程

时间:2011-06-28 14:42:50

标签: asp.net workflow asp.net-3.5 workflow-foundation workflowservice

我正在使用ASP.NET 3.5和WF 3.5。

我的代码不断给我一个FileNotFoundException。即使我已经创建了两个工作流实例。它一直试图抓住第一个工作流程(并告诉我装配不在那里),而不是第二个工作流程。这是我的代码:

Dim connectionString As String = ConfigurationManager.ConnectionStrings("LocalWFConnection").ConnectionString

    Dim trackingQuery As SqlTrackingQuery = New SqlTrackingQuery(connectionString)
    Dim options As SqlTrackingQueryOptions = New SqlTrackingQueryOptions()

    Dim workflws As IList(Of SqlTrackingWorkflowInstance)
    Try
        workflws = trackingQuery.GetWorkflows(options)

    Catch ex As SqlException

        workflowError = String.Format("A SQL exception occurred.  Details:<br />{0}", ex.Message)
        Return workflowData

    Catch ex As IO.FileNotFoundException

        workflowError = String.Format("File loading exception occurred. Details:<br />{0}", ex.Message)
        Return workflowData
    End Try

1 个答案:

答案 0 :(得分:0)

Dim trackingQuery As SqlTrackingQuery = New SqlTrackingQuery(connectionString)
Dim options As SqlTrackingQueryOptions = New SqlTrackingQueryOptions()
options.WorkflowType = GetType(Workflow1) ' where Workflow1 is the name of your Workflow