다음을 통해 공유


TrackingProfile.Version 속성

정의

추적 프로필의 버전을 가져오거나 설정합니다.

public:
 property Version ^ Version { Version ^ get(); void set(Version ^ value); };
public Version Version { get; set; }
member this.Version : Version with get, set
Public Property Version As Version

속성 값

VersionTrackingProfile입니다.

예제

다음 코드 예제에서는 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

설명

워크플로 런타임 엔진에 있는 프로필 캐싱의 의미 체계 때문에 TrackingProfile의 콘텐츠를 변경하는 경우 Version을 업데이트해야 합니다. 업데이트하지 않으면 TrackingProfile 호출에서 반환되거나 TrackingService.TryReloadProfile 이벤트와 연결된 ProfileUpdatedEventArgs에 포함되어 전송되는 경우에도 워크플로 런타임 엔진이 업데이트된 ProfileUpdated을 로드하지 않을 수도 있습니다. 따라서 워크플로 런타임 엔진이 업데이트된 TrackingProfile을 로드하게 하려면 Version에 대해 TrackingProfile을 변경해야 합니다. 해당 워크플로 인스턴스에서 명시적으로 WorkflowInstance.ReloadTrackingProfiles를 호출하거나 구현에 따라 추적 서비스를 사용하여 워크플로 런타임 엔진에 변경 내용을 알릴 수 있습니다. 자세한 내용은 TrackingService를 참조하세요.

적용 대상

추가 정보