TrackingWorkflowExceptionEventArgs 类

定义

警告

此 API 现已过时。

包含与工作流实例执行过程中发生的异常关联的数据。Contains data associated with an exception that occurs during the execution of a workflow instance.

public ref class TrackingWorkflowExceptionEventArgs : EventArgs
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
[System.Serializable]
public class TrackingWorkflowExceptionEventArgs : EventArgs
type TrackingWorkflowExceptionEventArgs = class
    inherit EventArgs
Public Class TrackingWorkflowExceptionEventArgs
Inherits EventArgs
继承
TrackingWorkflowExceptionEventArgs
属性

示例

下面的代码示例演示一个名为 WriteExceptionEventArgs 的方法,该方法可捕获 TrackingWorkflowExceptionEventArgsThe following code example demonstrates a method, named WriteExceptionEventArgs, which captures a TrackingWorkflowExceptionEventArgs. 代码将检查 Exception 属性是否为 null(在 Visual Basic 中为 Nothing)。The code checks whether the Exception property is null (Nothing in Visual Basic).

如果不是,代码会将与 Exception 属性关联的消息写入控制台。If it is not, the code writes the message associated with the Exception property to the console. 此外,代码会将 OriginalActivityPath 属性的值转换为字符串,并将其写入控制台。In addition, the code converts the value of the OriginalActivityPath property to a string and writes it to the console.

此代码示例摘自 Program.cs 文件中的 EventArgs 跟踪 SDK 示例。This code example is part of the EventArgs Tracking SDK sample from the Program.cs file. 有关详细信息, 请参阅EventArgs 跟踪示例For more information, see EventArgs Tracking Sample.

static void WriteExceptionEventArgs(string eventDescription, TrackingWorkflowExceptionEventArgs exceptionEventArgs, DateTime eventDataTime)
{
    Console.WriteLine("\nException Event Arguments Read From Tracking Database:\n");
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString());
    Console.WriteLine("EventDescription: " + eventDescription);
    if (null != exceptionEventArgs.Exception)
    {
        Console.WriteLine("ExceptionEventArgs Exception Message: " + exceptionEventArgs.Exception.Message.ToString());
    }
    Console.WriteLine("ExceptionEventArgs Original Activity Path: " + exceptionEventArgs.OriginalActivityPath.ToString());
}
Shared Sub WriteExceptionEventArgs(ByVal eventDescription As String, ByVal exceptionEventArgs As TrackingWorkflowExceptionEventArgs, ByVal eventDataTime As DateTime)
    Console.WriteLine(vbCrLf + "Exception Event Arguments Read From Tracking Database:")
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString(CultureInfo.CurrentCulture))
    Console.WriteLine("EventDescription: " + eventDescription)
    If exceptionEventArgs.Exception IsNot Nothing Then
        Console.WriteLine("ExceptionEventArgs Exception Message: " + exceptionEventArgs.Exception.Message.ToString())
    End If
    Console.WriteLine("ExceptionEventArgs Original Activity Path: " + exceptionEventArgs.OriginalActivityPath.ToString())
End Sub

注解

备注

本材料讨论的类型和命名空间已废弃不用。This material discusses types and namespaces that are obsolete. 有关详细信息,请参阅 Windows Workflow Foundation 4.5 中弃用的类型For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

当工作流实例执行过程中发生异常,并且与该工作流实例关联的 TrackingProfile 包括针对 WorkflowTrackPoint 配置的 TrackingWorkflowEvent.Exception 时,工作流跟踪基础结构会在它发送到跟踪服务的 EventArgs 中将 TrackingWorkflowExceptionEventArgs 设置为 WorkflowTrackingRecordWhen an exception occurs during the execution of a workflow instance and a TrackingProfile that is associated with the workflow instance includes a WorkflowTrackPoint configured for a TrackingWorkflowEvent.Exception, the workflow tracking infrastructure sets EventArgs to an TrackingWorkflowExceptionEventArgs in the WorkflowTrackingRecord that it sends to the tracking service.

备注

TrackingWorkflowExceptionEventArgs 仅由运行时跟踪服务使用,以在 WorkflowTrackingRecord 中传递信息。TrackingWorkflowExceptionEventArgs is used only by the runtime tracking service to pass information in a WorkflowTrackingRecord.

属性

ContextGuid

获取关联的活动的上下文 ID。Gets the context ID of the associated activity.

CurrentActivityPath

获取当前引发异常的活动的 QualifiedNameGets the QualifiedName of the activity currently throwing the exception.

Exception

获取工作流实例所引发的 ExceptionGets the Exception that is being thrown by the workflow instance.

OriginalActivityPath

获取原来引发异常的活动的 QualifiedNameGets the QualifiedName of the activity that originally threw the exception.

ParentContextGuid

获取父活动的上下文 ID。Gets the context ID of the parent activity.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅