WorkflowRuntimeService.OnStarted Method

Definition

When overridden in a derived class, represents the method that will be called when the workflow runtime engine raises the Started event.

protected:
 virtual void OnStarted();
protected virtual void OnStarted ();
abstract member OnStarted : unit -> unit
override this.OnStarted : unit -> unit
Protected Overridable Sub OnStarted ()

Remarks

The WorkflowRuntimeService class implements a two-phase starting mechanism so that workflow runtime engine services may perform any initialization that depends on other services after the workflow runtime engine has invoked the Start method for all of its workflow runtime engine services. After the workflow runtime engine has called the Start method of all of its workflow runtime engine services, it raises the WorkflowRuntime.Started event. You can override the OnStarted method to provide any final startup functionality required by your service when the WorkflowRuntime.Started event is raised. The mechanics of subscribing and unsubscribing from the WorkflowRuntime.Started event is handled internally.

Note

If your service is added to the workflow runtime engine by a call to AddService after the workflow runtime engine has already been started, the workflow runtime engine will call Start on your service. However, in this situation, the Started event has already occurred, therefore, your service may have to perform any initialization that it would ordinarily perform in OnStarted from inside the Start method. You can test IsStarted to determine whether the workflow runtime engine has been started.

State is set to Started before OnStarted is invoked. The default implementation of OnStarted performs no action.

Applies to