CSharpFeeds - All your C# feeds in one place.

Sponsors

Thursday, July 12, 2007

How to Add or Remove a Custom Workflow Runtime Service

by Keyvan Nayyeri via Keyvan Nayyeri on 7/12/2007 12:34:47 PM

In the past, I gave an introduction to custom workflow runtime services and how to create a custom workflow runtime service.  In this post, I want to talk about adding and removing services to or from workflow runtime.

This is very simple.  All you need is calling the AddService or RemoveService() methods of workflow runtime and passing an instance of your custom runtime service to them as shown in below example.

static void Main(string[] args)

{

    using(WorkflowRuntime workflowRuntime = new WorkflowRuntime())

    {

        CustomRuntime customRuntime = new CustomRuntime();

 

        workflowRuntime.AddService(customRuntime);

        workflowRuntime.StartRuntime();

 

        workflowRuntime.StopRuntime();

 

        workflowRuntime.RemoveService(customRuntime);

    }

}

The important point is you can't remove a runtime service of following types or types that are derived from them when runtime is running:

  • System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService
  • System.Workflow.Runtime.Hosting.WorkflowPersistenceService
  • System.Workflow.Runtime.Tracking.TrackingService
  • System.Workflow.Runtime.Hosting.WorkflowSchedulerService
  • System.Workflow.Runtime.Hosting.WorkflowLoaderService

Now playing: Yanni - Tribute

email it!bookmark it!digg it!

Original Post: How to Add or Remove a Custom Workflow Runtime Service

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us