WorkflowInstance.Suspend(String) Méthode

Définition

Interrompt l'instance de workflow.

public:
 void Suspend(System::String ^ error);
public void Suspend (string error);
member this.Suspend : string -> unit
Public Sub Suspend (error As String)

Paramètres

error
String

Description de la raison de la suspension de l'instance de workflow.

Exceptions

Le moteur d'exécution de workflow ne s'exécute pas.

Exemples

L'exemple de code suivant montre l'appel à Suspend sur un objet WorkflowInstance.

// Create a workflow runtime
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
// Create a workflow instance
WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(typeof(Workflow1));
// Start the workflow
workflowInstance.Start();
// Suspend the workflow, passing in a message
workflowInstance.Suspend("Workflow manually suspended");
' Create a workflow runtime
Dim workflowRuntime As New WorkflowRuntime()
' Create a workflow instance
Dim workflowInstance As WorkflowInstance = workflowRuntime.CreateWorkflow(GetType(Workflow1))
' Start the workflow
workflowInstance.Start()
' Suspend the workflow, passing in a message
workflowInstance.Suspend("Workflow manually suspended")

Remarques

L’instance de workflow est suspendue de façon synchrone. Si l'instance de workflow est déjà suspendue, aucune mesure est prise ; sinon, le moteur d'exécution de workflow interrompt l'instance, déclenche l'événement WorkflowSuspended et passe reason dans une WorkflowSuspendedEventArgs.

Notes

Suspend ne décharge pas l'instance de workflow.

S’applique à