TrackingService.GetProfile 메서드

정의

파생 클래스에서 재정의되어야 하며, 구현되는 경우 지정된 워크플로 인스턴스나 워크플로 유형에 대한 추적 프로필을 가져옵니다.

오버로드

GetProfile(Guid)

파생 클래스에서 재정의되어야 하며, 구현되는 경우 지정된 워크플로 인스턴스에 대한 추적 프로필을 반환합니다.

GetProfile(Type, Version)

파생 클래스에서 재정의되어야 하며, 구현되는 경우 지정된 워크플로 Type에 대한 버전으로 정규화된 추적 프로필을 반환합니다.

설명

추적 서비스는 특정 워크플로 유형 및 특정 워크플로 인스턴스에 사용할 수 있는 추적 프로필을 관리하는 작업을 담당합니다. 어떤 방법이든 선택하여 이 관리를 구현할 수 있습니다. 예를 들어 모든 워크플로 TrackingProfile 및 워크플로 인스턴스에 대해 동일한 Type을 반환할 수도 있고, 워크플로 인스턴스, 워크플로 TypeVersion에서 참조하는 복잡한 추적 프로필 저장소를 관리할 수도 있습니다.

GetProfile(Guid)

파생 클래스에서 재정의되어야 하며, 구현되는 경우 지정된 워크플로 인스턴스에 대한 추적 프로필을 반환합니다.

protected public:
 abstract System::Workflow::Runtime::Tracking::TrackingProfile ^ GetProfile(Guid workflowInstanceId);
protected internal abstract System.Workflow.Runtime.Tracking.TrackingProfile GetProfile (Guid workflowInstanceId);
abstract member GetProfile : Guid -> System.Workflow.Runtime.Tracking.TrackingProfile
Protected Friend MustOverride Function GetProfile (workflowInstanceId As Guid) As TrackingProfile

매개 변수

workflowInstanceId
Guid

워크플로 인스턴스의 Guid입니다.

반환

TrackingProfile

지정된 워크플로 인스턴스에 대한 추적 프로필입니다.

예제

다음 예제에서는 GetProfile 메서드의 구현을 보여 줍니다. 이 예제에서는 GetProfile 메서드의 여러 오버로드가 하드 코딩된 기본 추적 프로필을 반환하는 하나의 프라이빗 GetProfile 메서드를 호출합니다. 이 예제는 Termination Tracking Service SDK 샘플에 포함되어 있습니다. 자세한 내용은 종료 추적 서비스 샘플합니다.

/// <summary>
/// Returns a static tracking profile that only tracks instance terminated events.
/// </summary>
protected override TrackingProfile GetProfile(Guid workflowInstanceId)
{
    return GetProfile();
}
private volatile static TrackingProfile profile = null;
private bool sourceExists = false;
private TrackingProfile GetProfile()
{
    //
    // We shouldn't hit this point without the host ignoring an earlier exception.
    // However if we're here and the source doesn't exist we can't function.
    // Throwing an exception from here will block instance creation
    // but that is better than failing silently on termination
    // and having the admin think everything is OK because the event log is clear.
    if (!sourceExists)
        throw new InvalidOperationException(string.Format(System.Globalization.CultureInfo.InvariantCulture, "EventLog Source with the name '{0}' does not exist", source));

    //
    // The profile for this instance will never change
    if (null == profile)
    {
        lock (typeof(TerminationTrackingService))
        {
            if (null == profile)
            {
                profile = new TrackingProfile();
                profile.Version = new Version("3.0.0.0");
                WorkflowTrackPoint point = new WorkflowTrackPoint();
                point.MatchingLocation = new WorkflowTrackingLocation();
                point.MatchingLocation.Events.Add(TrackingWorkflowEvent.Terminated);
                profile.WorkflowTrackPoints.Add(point);
            }
        }
    }
    return profile;
}
'/ <summary>
'/ Returns a Shared tracking profile that only tracks instance terminated events.
'/ </summary>
Protected Overrides Function GetProfile(ByVal workflowInstanceId As Guid) As TrackingProfile
    Return GetProfile()
End Function

Private Shared profile As TrackingProfile = Nothing
Private sourceExists As Boolean = False
Private Overloads Function GetProfile() As TrackingProfile

    '
    ' We shouldn't hit me point without the host ignoring an earlier exception.
    ' However if we're here and the source doesn't exist we can't function.
    ' Throwing an exception from here will block instance creation
    ' but that is better than failing silently on termination 
    ' and having the admin think everything is OK because the event log is clear.
    If Not sourceExists Then
        Throw New InvalidOperationException(String.Format(System.Globalization.CultureInfo.InvariantCulture, "EventLog Source with the name '0}' does not exist", source))
    End If
    '
    ' The profile for me instance will never change
    If profile Is Nothing Then

        SyncLock (GetType(TerminationTrackingService))

            If profile Is Nothing Then

                profile = New TrackingProfile()
                profile.Version = New Version("3.0.0.0")
                Dim point As New WorkflowTrackPoint()
                point.MatchingLocation = New WorkflowTrackingLocation()
                point.MatchingLocation.Events.Add(TrackingWorkflowEvent.Terminated)
                profile.WorkflowTrackPoints.Add(point)
            End If
        End SyncLock

    End If

    Return profile
End Function

설명

추적 서비스는 특정 워크플로 유형 및 특정 워크플로 인스턴스에 사용할 수 있는 추적 프로필을 관리하는 작업을 담당합니다. 어떤 방법이든 선택하여 이 관리를 구현할 수 있습니다. 예를 들어 모든 워크플로 TrackingProfile 및 워크플로 인스턴스에 대해 동일한 Type을 반환할 수도 있고, 워크플로 인스턴스, 워크플로 TypeVersion에서 참조하는 복잡한 추적 프로필 저장소를 관리할 수도 있습니다.

적용 대상

GetProfile(Type, Version)

파생 클래스에서 재정의되어야 하며, 구현되는 경우 지정된 워크플로 Type에 대한 버전으로 정규화된 추적 프로필을 반환합니다.

protected public:
 abstract System::Workflow::Runtime::Tracking::TrackingProfile ^ GetProfile(Type ^ workflowType, Version ^ profileVersionId);
protected internal abstract System.Workflow.Runtime.Tracking.TrackingProfile GetProfile (Type workflowType, Version profileVersionId);
abstract member GetProfile : Type * Version -> System.Workflow.Runtime.Tracking.TrackingProfile
Protected Friend MustOverride Function GetProfile (workflowType As Type, profileVersionId As Version) As TrackingProfile

매개 변수

workflowType
Type

워크플로의 Type입니다.

profileVersionId
Version

추적 프로필의 Version입니다.

반환

TrackingProfile

지정된 워크플로 형식에 대한 추적 프로필입니다.

설명

추적 서비스는 특정 워크플로 유형 및 특정 워크플로 인스턴스에 사용할 수 있는 추적 프로필을 관리하는 작업을 담당합니다. 어떤 방법이든 선택하여 이 관리를 구현할 수 있습니다. 예를 들어 모든 워크플로 TrackingProfile 및 워크플로 인스턴스에 대해 동일한 Type을 반환할 수도 있고, 워크플로 인스턴스, 워크플로 TypeVersion에서 참조하는 복잡한 추적 프로필 저장소를 관리할 수도 있습니다.

적용 대상