views:

713

answers:

3

I have a simple business workflow with the following conditions

  1. Users need to change the workflow itself using a desinger
  2. The workflow is a long rinning workflow, so it will be serialized

Is there a way to automate the task of versioning different workflow assemblies?

+3  A: 

The versioning of different workflow assemblies is not a trivial task and has a lot of complications. Here you can find a series of posts that deal exactly with this.

Panos
+2  A: 

You can rehost the WF designer in your own application to let the end users change workflows. As you are hosting the designer you pretty much control what they can do. For example you can prevent them from removing or disabling activities and only allow them to add specific new activities in predefined area's of the workflow. The best approach is to save these workflows as XOML files and start them as such. This does mean you cannot add code to the workflow itself but you are free to define your workflow base class derived from SequentialWorkflowActivity (or the state equivalent) and use that as the workflow base class. This allows you to add code and properties. For example you can still add a CodeActivity but you need to link to code in the base class.

Workflow serialization, or dehydration as it is called, is used with running workflows to persist them to disk. This uses standard .NET binary serialization and can be a but tricky due to the long running nature of workflows. But no big deal once you know what to look for. See http://msmvps.com/blogs/theproblemsolver/archive/2008/09/10/versioning-long-running-workfows.aspx for the start of a series of blog posts.

Not sure if you need it but there is also the capability to change already executing workflows. This uses the WorkflowChanges object. See here http://wiki.windowsworkflowfoundation.eu/default.aspx/WF/RuntimeModificationOfWorkflows.html for more details.

Maurice
Since the author of the reference in my answer is here, my answer is obsolete... My up-vote for your excellent posts (and the blog in general).
Panos
A: 

Here is another article on workflow versioning:

http://www.adefwebserver.com/DotNetNukeHELP/Workflow/VacationRequest3.htm

Basically you can version workflows that use assemblies if:

  • Any assembly used with workflows must be strong named.
  • If a assembly uses an interface it also must be strong named and placed in a separate assembly.
  • An entry in the web.config can instruct asp.net where to find the proper assembly.
Michael Washington