Tracking_SqlTrackingQuery(2)

  WorkFlow状态对象:WorkflowTrackingRecord

WorkFlow状态对象WorkflowTrackingRecord以集合成员的方式存于SqlTrackingWorkflowInstanceWorkflowEvents集合中

 无须在WorkflowRuntime宿主程序中

        Shared Sub 得到实例运行状况列表(ByVal 实例Id As Guid)

            Dim sql As String = "Initial Catalog=Tracking;Data Source=WXWINTER\SQLEXPRESS;Integrated Security=SSPI;"

            Dim 查询 As SqlTrackingQuery = New SqlTrackingQuery(sql)

            Dim 被查询的实例 As SqlTrackingWorkflowInstance = Nothing

            查询.TryGetWorkflow(实例Id, 被查询的实例)

 

            If 被查询的实例 IsNot Nothing Then

                Console.WriteLine("工作流实例曾发生的状态列表:")

 

                Dim 实例状态 As WorkflowTrackingRecord

                For Each 实例状态 In 被查询的实例.WorkflowEvents

                    Console.WriteLine("曾发生的状态" + 实例状态.TrackingWorkflowEvent.ToString)

                    Console.WriteLine("该状态发生的时间" + 实例状态.EventDateTime.ToString)

                    Console.WriteLine("EventOrder字段值:" + 实例状态.EventOrder.ToString)

 

                    '工作流实例可能会有如下状态

                    'Aborted Changed Completed Created Exception Idle Loaded

                    'Persisted Resumed Started Suspended Terminated Unloaded

                Next

            End If

        End Sub


 

属性

Annotations

 

EventArgs

 

EventDateTime

记录该实例状态的时间

EventOrder

EventOrder字段值

TrackingWorkflowEvent

状态说明,TrackingWorkflowEvent类型,值如下
Aborted Changed Completed Created Exception Idle Loaded
 Persisted Resumed Started Suspended Terminated Unloaded

posted @ 2006-09-25 03:37  WXWinter(冬)  阅读(1452)  评论(1编辑  收藏  举报