Probably I have some understanding problem of WF
If I have some old-version workflow instance saved in the database, and I want them going on in a new-version workflow , how can I ?
Zhuang,
Is this only occuring on the dynamic update, or when you're re-loading an already dynamically updated workflow?
If you have any code snippets or stack traces of the failure that'd help too.
Arjun
Zhuang,
After you update the workflow and re-publish the assembly, it sounds like you're overwriting the old assembly to which the persisted instance referred to. To properly handle this, you should use .NET versioning and increment your workflow assembly version before deploying it to the GAC. That way, when the persisted instance is reloaded, the runtime will locate the correct assembly. Note that this only applies to workflow updates made at design-time, when you recompile and publish an updated assembly. If you're only using dynamic update to modify an instance, you don't need to worry about these assembly versioning issues.
Arjun
As far as I understand, workflow is a definition of a business process execution. Workflow instance is a data record related to some particular instance of this business process. As soon as a structure of business-process related data is not changed, it should not be a problem to update the definition.
For example, I have a state machine workflow that sends an e-mail to an address. What is the process related data? Workflow guid, current state of the workflow and e-mail address. I need to persist only these 3 properties of the workflow to be able to activate it. Do I need to persist something more? No, because other properties are set in code.
Is it generally possible to force WF to behave this way?
Probably I have some understanding problem of the WF, but what's a point to allow user modify a workflow if his change will destroy all running workflows?
It won't destroy all running workflows, it just requires you to version your production workflow assemblies.
That said, I totally agree with you, it would be real nice to be able to change persisted workflows to match a new version of the workflow, thus only requiring the latest workflow assembly. It will become a real troubleshooting nightmare when you start having 4-5+ assembly versions in the GAC and have problems with older persisted workflows.
If anyone has ideas on how to approach this, it would be appreciated.
Thanks Jeff