Export (0) Print
Expand All

WorkflowRuntime.WorkflowPersisted Event

Occurs when the state of a workflow instance is persisted.

Namespace:  System.Workflow.Runtime
Assembly:  System.Workflow.Runtime (in System.Workflow.Runtime.dll)

public event EventHandler<WorkflowEventArgs> WorkflowPersisted

The workflow instance can be persisted for many reasons. For example, the host can call WorkflowInstance.UnLoad on a workflow instance, or the workflow run-time engine can persist a workflow instance because the instance is idle or because an atomic scope has completed. If a persistence service is present in the WorkflowRuntime, WorkflowPersisted is raised by the runtime after the state of the workflow instance is saved to memory. If a persistence service is not present, the event is still raised but the instance state is not saved. If the WorkflowPersisted event occurs because the workflow instance is being unloaded, it is followed by a WorkflowUnloaded event.

For the WorkflowPersisted event, the sender contains the WorkflowRuntime and WorkflowEventArgs contains the WorkflowInstance associated with the event.

For more information about handling events, see Consuming Events.

The following code example demonstrates how you can use WorkflowRuntime functionality from a workflow host. The code associates the WorkflowPersisted with an event handler, a method named OnWorkflowPersisted.

This code example is part of the Custom Persistence Service Sample.

workflowRuntime.WorkflowPersisted += OnWorkflowPersisted;

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0
Show:
© 2015 Microsoft