다음을 통해 공유


TrackingProfile.WorkflowTrackPoints 속성

정의

런타임 추적 인프라가 워크플로 상태 이벤트를 필터링하는 데 사용하는 워크플로 추적 지점 컬렉션을 가져옵니다.

public:
 property System::Workflow::Runtime::Tracking::WorkflowTrackPointCollection ^ WorkflowTrackPoints { System::Workflow::Runtime::Tracking::WorkflowTrackPointCollection ^ get(); };
public System.Workflow.Runtime.Tracking.WorkflowTrackPointCollection WorkflowTrackPoints { get; }
member this.WorkflowTrackPoints : System.Workflow.Runtime.Tracking.WorkflowTrackPointCollection
Public ReadOnly Property WorkflowTrackPoints As WorkflowTrackPointCollection

속성 값

런타임 추적 인프라가 WorkflowTrackPointCollection를 추적 서비스로 보내야 하는 워크플로 인스턴스의 지점을 지정하는 WorkflowTrackingRecord입니다.

예제

다음 코드 예제에서는 TrackingProfile 생성자를 사용하여 TrackingProfile을 만드는 방법 및 해당 개체의 속성을 사용하여 워크플로 실행을 추적하는 방법을 보여 줍니다. 예제 코드에서는 ActivityTrackPoints, VersionWorkflowTrackPoints 속성을 사용합니다.

이 코드 예제는 Program.cs 파일에 있는 Query using SQLTrackingService SDK 샘플의 일부입니다. 자세한 내용은 쿼리를 사용 하 여 SQLTrackingService합니다.

private static void CreateAndInsertTrackingProfile()
{
    TrackingProfile profile = new TrackingProfile();
    ActivityTrackPoint activityTrack = new ActivityTrackPoint();
    ActivityTrackingLocation activityLocation = new ActivityTrackingLocation(typeof(Activity));
    activityLocation.MatchDerivedTypes = true;
    IEnumerable<ActivityExecutionStatus> statuses = Enum.GetValues(typeof(ActivityExecutionStatus)) as IEnumerable<ActivityExecutionStatus>;
    foreach (ActivityExecutionStatus status in statuses)
    {
        activityLocation.ExecutionStatusEvents.Add(status);
    }

    activityTrack.MatchingLocations.Add(activityLocation);
    profile.ActivityTrackPoints.Add(activityTrack);
    profile.Version = version;

    WorkflowTrackPoint workflowTrack = new WorkflowTrackPoint();
    WorkflowTrackingLocation workflowLocation = new WorkflowTrackingLocation();
    IEnumerable<TrackingWorkflowEvent> eventStatuses = Enum.GetValues(typeof(TrackingWorkflowEvent)) as IEnumerable<TrackingWorkflowEvent>;
    foreach (TrackingWorkflowEvent status in eventStatuses)
    {
        workflowLocation.Events.Add(status);
    }

    workflowTrack.MatchingLocation = workflowLocation;
    profile.WorkflowTrackPoints.Add(workflowTrack);

    TrackingProfileSerializer serializer = new TrackingProfileSerializer();
    StringWriter writer = new StringWriter(new StringBuilder(), CultureInfo.InvariantCulture);
    serializer.Serialize(writer, profile);
    string trackingprofile = writer.ToString();
    InsertTrackingProfile(trackingprofile);
}
Shared Sub CreateAndInsertTrackingProfile()
    Dim profile As TrackingProfile = New TrackingProfile()

    Dim activityTrack As ActivityTrackPoint = New ActivityTrackPoint()
    Dim activityLocation As ActivityTrackingLocation = New ActivityTrackingLocation(GetType(Activity))
    activityLocation.MatchDerivedTypes = True
    Dim statuses As IEnumerable(Of ActivityExecutionStatus) = CType(System.Enum.GetValues(GetType(ActivityExecutionStatus)), IEnumerable(Of ActivityExecutionStatus))
    For Each status As ActivityExecutionStatus In statuses
        activityLocation.ExecutionStatusEvents.Add(status)
    Next

    activityTrack.MatchingLocations.Add(activityLocation)
    profile.ActivityTrackPoints.Add(activityTrack)
    profile.Version = version

    Dim workflowTrack As WorkflowTrackPoint = New WorkflowTrackPoint()
    Dim workflowLocation As WorkflowTrackingLocation = New WorkflowTrackingLocation()
    Dim eventStatuses As IEnumerable(Of TrackingWorkflowEvent) = CType(System.Enum.GetValues(GetType(TrackingWorkflowEvent)), IEnumerable(Of TrackingWorkflowEvent))
    For Each status As TrackingWorkflowEvent In eventStatuses
        workflowLocation.Events.Add(status)
    Next

    workflowTrack.MatchingLocation = workflowLocation
    profile.WorkflowTrackPoints.Add(workflowTrack)

    Dim serializer As TrackingProfileSerializer = New TrackingProfileSerializer()
    Dim writer As StringWriter = New StringWriter(New StringBuilder(), CultureInfo.InvariantCulture)
    serializer.Serialize(writer, profile)
    Dim trackingProfile As String = writer.ToString()
    InsertTrackingProfile(trackingProfile)
End Sub

설명

워크플로 인스턴스의 상태가 변경되었음을 나타내는 TrackingWorkflowEvent가 발생할 때마다 워크플로 인스턴스는 런타임 추적 인프라에 워크플로 상태 이벤트를 내보냅니다. 런타임 추적 인프라는 WorkflowTrackPoints 속성을 사용하여 이러한 워크플로 상태 이벤트를 필터링하고 WorkflowTrackingRecord를 추적 서비스로 보낼 시기를 결정합니다. WorkflowTrackPointWorkflowTrackPoints 속성에 추가하여 WorkflowTrackingRecord를 보내도록 할 워크플로 인스턴스의 잠재적 실행 경로에 관심 지점을 지정할 수 있습니다.

WorkflowTrackPoint는 실제로 워크플로 인스턴스에 물리적 지점을 정의하는 대신 런타임 추적 인프라가 워크플로 상태 이벤트를 일치시키는 데 사용할 수 있는 하나 이상의 TrackingWorkflowEvent 값을 정의합니다. 따라서 워크플로 인스턴스 수명 동안 동일한 WorkflowTrackPoint가 여러 번 일치할 수 있습니다. WorkflowTrackPointWorkflowTrackingRecord에 반환될 주석을 지정할 수도 있습니다.

적용 대상

추가 정보