WorkflowApplication.PersistableIdle Property

Definition

Gets or sets the delegate that is invoked when the current workflow instance is idle and can be persisted.

public:
 property Func<System::Activities::WorkflowApplicationIdleEventArgs ^, System::Activities::PersistableIdleAction> ^ PersistableIdle { Func<System::Activities::WorkflowApplicationIdleEventArgs ^, System::Activities::PersistableIdleAction> ^ get(); void set(Func<System::Activities::WorkflowApplicationIdleEventArgs ^, System::Activities::PersistableIdleAction> ^ value); };
public Func<System.Activities.WorkflowApplicationIdleEventArgs,System.Activities.PersistableIdleAction> PersistableIdle { get; set; }
member this.PersistableIdle : Func<System.Activities.WorkflowApplicationIdleEventArgs, System.Activities.PersistableIdleAction> with get, set
Public Property PersistableIdle As Func(Of WorkflowApplicationIdleEventArgs, PersistableIdleAction)

Property Value

The delegate that is invoked when the current workflow instance is idle and can be persisted.

Examples

The following example handles the PersistableIdle handler and instructs the runtime to persist and unload the workflow.

wfApp.PersistableIdle = delegate(WorkflowApplicationIdleEventArgs e)
{
    // Instruct the runtime to persist and unload the workflow
    return PersistableIdleAction.Unload;
};

Remarks

When a workflow becomes idle and can be persisted, both Idle and PersistableIdle are invoked, in that order. The PersistableIdle handler returns one of the PersistableIdleAction enumeration values of None, Persist, or Unload.

Applies to