TrackingWorkflowTerminatedEventArgs.Exception 속성

정의

워크플로 인스턴스가 종료되게 한 예외를 가져옵니다.

public:
 property Exception ^ Exception { Exception ^ get(); };
public Exception Exception { get; }
member this.Exception : Exception
Public ReadOnly Property Exception As Exception

속성 값

워크플로 인스턴스가 종료되게 한 Exception입니다.

예제

다음 코드 예제에서는 WriteTerminatedEventArgs를 캡처하는 TrackingWorkflowTerminatedEventArgs라는 메서드를 보여 줍니다. 이 코드에서는 Exception 속성이 null (Visual Basic의 경우 Nothing)인지 여부를 확인합니다. 그렇지 않으면 코드에서는 Exception 속성과 연결된 메시지를 콘솔에 씁니다. Exceptionnull(Nothing)이면 코드에서 예외 정보를 콘솔에 쓰지 않습니다.

이 코드 예제는 Program.cs 파일에 있는 EventArgs Tracking SDK 샘플의 일부입니다. 자세한 내용은 EventArgs Tracking 샘플합니다.

static void WriteTerminatedEventArgs(string eventDescription, TrackingWorkflowTerminatedEventArgs terminatedEventArgs, DateTime eventDataTime)
{
    Console.WriteLine("\nTerminated Event Arguments Read From Tracking Database:\n");
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString());
    Console.WriteLine("EventDescription: " + eventDescription);
    if (null != terminatedEventArgs.Exception)
    {
        Console.WriteLine("TerminatedEventArgs Exception Message: " + terminatedEventArgs.Exception.Message.ToString());
    }
}
Shared Sub WriteTerminatedEventArgs(ByVal eventDescription As String, ByVal terminatedEventArgs As TrackingWorkflowTerminatedEventArgs, ByVal eventDataTime As DateTime)
    Console.WriteLine(vbCrLf + "Terminated Event Arguments Read From Tracking Database:")
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString(CultureInfo.CurrentCulture))
    Console.WriteLine("EventDescription: " + eventDescription)
    If terminatedEventArgs.Exception IsNot Nothing Then
        Console.WriteLine("TerminatedEventArgs Exception Message: " + terminatedEventArgs.Exception.Message.ToString())
    End If
End Sub

설명

처리되지 않은 예외로 인해 워크플로 인스턴스가 종료되는 경우 Exception은 처리되지 않은 예외를 포함합니다.

에 대한 호스트 호출 WorkflowInstance.Terminate 또는 TerminateActivity 활동에 Exception 의해 워크플로 instance 종료되는 경우 에는 해당 Message 속성이 종료 이유에 대한 설명으로 설정된 가 포함 WorkflowTerminatedException 됩니다. 호스트는 워크플로 인스턴스를 종료하는 경우 string에 대한 WorkflowInstance.Terminate 매개 변수에 이 설명을 제공합니다. TerminateActivity가 워크플로 인스턴스를 종료하는 경우에는 TerminateActivity.Error에서 설명을 제공합니다.

적용 대상

추가 정보