TrackingService.TryReloadProfile(Type, Guid, TrackingProfile) Méthode

Définition

Doit être substitué dans la classe dérivée et, en cas d'implémentation, récupère un nouveau modèle de suivi pour l'instance de workflow spécifiée si le modèle de suivi a changé depuis son dernier chargement.

protected public:
 abstract bool TryReloadProfile(Type ^ workflowType, Guid workflowInstanceId, [Runtime::InteropServices::Out] System::Workflow::Runtime::Tracking::TrackingProfile ^ % profile);
protected internal abstract bool TryReloadProfile (Type workflowType, Guid workflowInstanceId, out System.Workflow.Runtime.Tracking.TrackingProfile profile);
abstract member TryReloadProfile : Type * Guid * TrackingProfile -> bool
Protected Friend MustOverride Function TryReloadProfile (workflowType As Type, workflowInstanceId As Guid, ByRef profile As TrackingProfile) As Boolean

Paramètres

workflowType
Type

Type de l'instance de workflow.

workflowInstanceId
Guid

Guid de l'instance de workflow.

profile
TrackingProfile

Cette méthode retourne le TrackingProfile à charger. Ce paramètre est passé sans être initialisé.

Retours

true si un nouveau TrackingProfile doit être chargé ; sinon, false. Si true, le TrackingProfile est retourné dans profile.

Exemples

L'exemple suivant illustre une implémentation de base de la méthode TryReloadProfile. Cet exemple provient de l'exemple du Kit de développement logiciel Termination Tracking Service (SDK). Pour plus d’informations, consultez Exemple de service de suivi des interruptions.

/// <summary>
/// Always returns false; this tracking service has no need to reload its tracking profile for a running instance.
/// </summary>
/// <param name="workflowType"></param>
/// <param name="workflowInstanceId"></param>
/// <param name="profile"></param>
/// <returns></returns>
protected override bool TryReloadProfile(Type workflowType, Guid workflowInstanceId, out TrackingProfile profile)
{
    //
    // There is no reason for this service to ever reload a profile
    profile = null;
    return false;
}
' Always returns false me tracking service has no need to reload its tracking profile for a running instance.
' <param name="workflowType"></param>
' <param name="workflowInstanceId"></param>
' <param name="profile"></param>
' <returns></returns>
Protected Overrides Function TryReloadProfile(ByVal workflowType As Type, ByVal workflowInstanceId As Guid, ByRef profile As TrackingProfile) As Boolean
    '
    ' There is no reason for me service to ever reload a profile
    profile = Nothing
    Return False
End Function

Remarques

TryReloadProfile est appelé par l'infrastructure de suivi d'exécution afin de déterminer si un nouveau TrackingProfile doit être chargé pour l'instance de workflow spécifiée. Si un nouveau TrackingProfile est requis, il est retourné dans profile. Si vous souhaitez que l'infrastructure de suivi d'exécution cesse d'effectuer le suivi d'une instance de workflow, votre service de suivi doit retourner true et définir profile à une valeur égale à une référence Null (Nothing en Visual Basic). Votre service de suivi peut utiliser workflowType ou workflowInstanceId comme bon vous semble pour déterminer si un profil de suivi doit être rechargé. Par exemple, SqlTrackingService utilise uniquement workflowInstanceId pour décider si le modèle de suivi doit être rechargé. La méthode TryReloadProfile est appelée par l'infrastructure de suivi d'exécution d'après sa propre sémantique de suivi, ou en réponse à l'appel d'un hôte ou d'un service à la méthode WorkflowInstance.ReloadTrackingProfiles sur une instance de flux de travail.

S’applique à