Export (0) Print
Expand All

Creating Custom Scheduling Services

A workflow scheduler service is a service that is used by the workflow runtime engine to determine which threads are used to start workflows. By creating a custom workflow scheduler service, you can control what threads the workflow runtime uses.

Two workflow scheduler services are provided:

To create a custom scheduling service, you must derive from the WorkflowSchedulerService base class and provide implementations for three methods. These methods are called by the workflow runtime engine when it needs to execute workflows.

  • Schedule

    This method is called by the workflow runtime engine to request that a workflow instance be started immediately. The implementation of this method should invoke the callback method, on an appropriate thread, passing in the workflowInstanceId as a parameter.

  • Schedule

    This method is called by the workflow runtime engine to request that a workflow instance be executed sometime in the future. The implementation of this method should invoke the callback method, passing the workflowInstanceId. It should invoke the callback no earlier than the specified UTC time.

  • Cancel

    This method is called by the runtime engine to cancel a request for a previously scheduled workflow. The System.Guid that is passed as a parameter to this method will match the timerId parameter of a previous invocation of the Schedule method. Requests to cancel workflows that have already executed can be ignored.

    ms734585.note(en-us,VS.90).gifNote:
    When a workflow is unloaded, its outstanding schedule requests are canceled. When a workflow is reloaded, the requests are rescheduled at that time.

See Also

Community Additions

ADD
Show:
© 2014 Microsoft