Tracking_SqlTrackingQuery(3)
Activity状态对象:ActivityTrackingRecord
Activity状态对象ActivityTrackingRecord以集合成员的方式存于SqlTrackingWorkflowInstance的ActivityEvents集合中
无须在WorkflowRuntime宿主程序中
Shared Sub 得到Activity运行状况列表(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(vbCrLf + "Activity 曾发生的状态列表:" + vbCrLf) Console.WriteLine() Dim Activity状态As ActivityTrackingRecord For Each Activity状态In 被查询的实例.ActivityEvents Console.WriteLine("Activity类型:" + Activity状态.ActivityType.ToString) Console.WriteLine("Activity上下文GUID:" + Activity状态.ContextGuid.ToString) Console.WriteLine("该状态发生的时间:" + Activity状态.EventDateTime.ToString) Console.WriteLine("Activity曾发生的状态:" + Activity状态.ExecutionStatus.ToString) Console.WriteLine("EventOrder字段值:" + Activity状态.EventOrder.ToString) Console.WriteLine("Activity容器对象GUID:" + Activity状态.ParentContextGuid.ToString) Console.WriteLine("Activity名(开发时对象名):" + Activity状态.QualifiedName) Console.WriteLine() '此时,该WorkFlow 类本身也作为一个Activity被记录状态,他是所有Activity的容器 '有些Activity可以成为另一个Activity的容器 'Activity可能会有如下状态 'Canceling、Closed、Compensating、Executing、Faulting、Initialized Next End If |
属性
ActivityType |
Activity类型 |
Annotations |
|
Body |
|
ContextGuid |
Activity上下文GUID |
EventArgs |
|
EventDateTime |
该状态发生的时间 |
EventOrder |
EventOrder字段值 |
ExecutionStatus |
状态说明,ActivityExecutionStatus类型,值如下 |
ParentContext |
Activity容器对象GUID |
QualifiedName |
Activity名(开发时对象名) |