Bagikan melalui


TrackingProfile.WorkflowTrackPoints Properti

Definisi

Mendapatkan kumpulan titik trek alur kerja yang digunakan oleh infrastruktur pelacakan runtime untuk memfilter peristiwa status alur kerja.

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

Nilai Properti

WorkflowTrackPointCollection yang menentukan titik dalam instans alur kerja tempat infrastruktur pelacakan runtime harus mengirim WorkflowTrackingRecord ke layanan pelacakan.

Contoh

Contoh kode berikut menunjukkan bagaimana Anda dapat membuat TrackingProfile menggunakan TrackingProfile konstruktor dan menggunakan properti objek untuk membantu melacak eksekusi alur kerja. Kode contoh menggunakan ActivityTrackPointsproperti , Version, dan WorkflowTrackPoints .

Contoh kode ini adalah bagian dari Kueri menggunakan sampel SQLTrackingService SDK dari file Program.cs. Untuk informasi selengkapnya, lihat Kueri Menggunakan 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

Keterangan

Instans alur kerja memancarkan peristiwa status alur kerja ke infrastruktur pelacakan runtime setiap kali TrackingWorkflowEvent terjadi yang menunjukkan bahwa status instans alur kerja telah berubah. Infrastruktur pelacakan runtime menggunakan WorkflowTrackPoints properti untuk memfilter peristiwa status alur kerja ini untuk menentukan kapan harus mengirim WorkflowTrackingRecord ke layanan pelacakan. Anda dapat menambahkan WorkflowTrackPoint ke WorkflowTrackPoints properti untuk menentukan tempat menarik di jalur eksekusi potensial instans alur kerja yang ingin WorkflowTrackingRecord Anda kirim.

WorkflowTrackPoint tidak benar-benar menentukan titik fisik dalam instans alur kerja, tetapi sebaliknya menentukan satu atau beberapa TrackingWorkflowEvent nilai yang dapat digunakan oleh infrastruktur pelacakan runtime untuk mencocokkan peristiwa status alur kerja. Oleh karena itu, hal yang sama WorkflowTrackPoint dapat dicocokkan berkali-kali selama masa pakai instans alur kerja. WorkflowTrackPoint juga dapat menentukan anotasi apa pun yang akan dikembalikan di WorkflowTrackingRecord.

Berlaku untuk

Lihat juga