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 {
	void add(EventHandler<WorkflowEventArgs^>^ value);
	void remove(EventHandler<WorkflowEventArgs^>^ value);
}

The workflow instance can be persisted for many reasons. For example, the host can call M:System.Workflow.Runtime.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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: