Probably I have some understanding problem of WF

I custom the workflow persistence service and save the workflow activity in Oracle database. After I modified the workflow design (for example: add a State activity), the Deserialize method fail: 'Load workflow instance failed: Index out of the bound of array'. Is it for the update of the workflow? And how can I solve the problem? Should I use WorkflowChanges object to modify all the workflow instances in the inside or outside?
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 ?
[578 byte] By [ZhuangYicheng] at [2007-12-21]
# 1

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

ArjunBanker at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 2
Arjun Banker,
It happens when I am re-loading a dynamically updated workflow.
The scenario is : I added a workflow in a workflow project, and published it as webservice. I customed the persistence service saving the workflow instances in Oracle database, and added the persistence service in runtime services. It worked fine. But after I modified the workflow and re-published it as webservice, I got a error response in client program : '...WorkflowInstanceLoad fail ... Index out of the Bound of Array ... at Deserialize method ... at Activity.Load() ... '. It seems for the workflow activity I saved does not match the workflow modified . So, how can I re-load the old-version workflow instance? Should I persist the old-version workflow?
The user requisition changes frequently, and we have to update the workflow in time. Then, if I updated the workflow and published it, how can I reload the persisted workflow instance? Should I reload the workflow instance before publishing the new-version workflow, and use WorkflowUpdates to update the workflow instance?
ZhuangYicheng at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 3

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

ArjunBanker at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 4

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?

AlexeyLavnikov at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 5

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

Esprit at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified