WorkflowInstance.Suspend(String) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Suspends the workflow instance.
public:
void Suspend(System::String ^ error);
public void Suspend(string error);
member this.Suspend : string -> unit
Public Sub Suspend (error As String)
- error
- String
A description of the reason for suspending the workflow instance.
The workflow runtime engine is not running.
The following code example demonstrates calling Suspend on a WorkflowInstance object.
// 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")
The workflow instance is suspended in a synchronous manner. If the workflow instance is already suspended, no action is taken; otherwise, the workflow runtime engine suspends the workflow instance, raises the WorkflowSuspended event and passes reason
in a WorkflowSuspendedEventArgs.
Бележка
Suspend does not unload the workflow instance.
Продукт | Версии |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка: