I'm writing a system that uses the StateMachine Workflow. There will be many long running instances persisted in the database.
Say I want add a simple activity to an existing event handler. Say send an email out. There are existing workflow sitting at that state waiting for external events.
Currently when you make such a change your existing workflows are dead you get the. EventDeliveryFailedException.
I would hope that I don't have to version my DLLs each time I make a simple change that adds to the work flow. Am I missing something
Thanks, Jeff

Workflow changes over time
majellao
Hi,
To do what you describe in the way that you describe, you would need to version your Dlls. A persisted workflow that rehydrates will need the exact version of the assembly that implemented the workflow as it was before it was hydrated. If this type of thing might be a common requirement in your program then you could implement it without requiring workflow changes but putting these types of actions in the host application and calling a method in the host using CallExternalMethodActivity. Then your workflow could call this method at the appropriate time, and if the handling requirements are changed, your host (via its local services implementation) could provide the new behavior.
Another implementation would be that when your previous version Workflows are hydrated, you could use DynamicUpdqate and WorkflowChanges to make the required updates to bring the running workflow in line with the newer modified workflow.
There is a couple of good posts describing this on these forums here:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=302495&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=192233&SiteID=1
Steve Danielson [Microsoft]
This posting is provided "AS IS" with no warranties, and confers no rights.
Rick Wong
I suggest you contact the author at http://weblogs.asp.net/rosherove/contact.aspx.
Bye,
matra
Nim Chu
Thanks. Sounds like a great way around it, but the download link is broken.
Jeff
Roel van Lisdonk
Jeff,
I agree with you that binary serialization could by a major problem when you have long runing workflows.
You might want to take a look at this (I have not tried it yet).
http://weblogs.asp.net/rosherove/archive/2005/03/03/384267.aspx
You will have to plug in your own serializer insted of default BinarySerializer.
Bye,
Matra
Cornelius Wolf
I'm certain the workflow is going to change quite often enough that versioning dlls is going get quite crazy/ugly.
I'm also concerned about coupling between my server host and the client. In some cases the changes to the client will require persisted workflows to be updated to the new version.
I'm not fond of implementing all workflow changes as code based dynamic updates. You lose the visual appeal of the workflow designer.
Question:
Is is possible to dynamically update persisted workflows so they match the newly changed workflow ie) next time they are rehydrated they match. I don't have a problem writing a special persisted workflow update program with each workflow change.
Thanks, Jeff.