Question

I have a very simple workflow as seen here: workflow diagram

When a user goes to act on a task, they are presented with an InfoPath form. The form displays some information. The user either selected 'Approve' or 'Reject' from a drop down. When they hit 'Submit', a field called 'approve' in the Tasks extended properties is set. Once approved, the code sets some email properties and other properties based on the selection, sends an email, then completes the task. This all works perfectly and has been tested countless times.

I then needed to deploy an update to the workflow, so I made my code changes, packaged the WSP, and ran an Update-SPSolution on the workflow. Created a new instance of the workflow (old workflow set to no new instances), and everything works fine. What I'm finding that is those workflows that were created on the original version, if the workflow is sitting at the OnTaskChanged activity, it does not pickup when a user interacts with the InfoPath form. The associated task is updated, but the on task changed does not seem to fire (as other things are not set/moved forward).

I'm lost on how to troubleshoot this short of running a new instance of the workflow on all of the broken ones.

Edit 1

When creating the new workflow associations, the same Tasks and Workflow History Lists are reused.

Edit 2

Just walked thru the same scenario in my local environment, of not updating a task until a new version of the workflow is out, and I did not have an issue. This seems to be only occurring in the production environment (go figure).

Was it helpful?

Solution

First I need to make a statement: Workflows are evil.

I spend countless hours trying to solve similar issues back on SP2007. As far as I know safe way to update existing workflows doesn't exist. Sometimes minor changes can be done but in most cases you will experience problems and 'old' workflows will stop responding. My guess is that some correlation id's get mixed up in upgrade process.

While evaluating SP2010 Beta I asked Microsoft guy about this issue and if there are some changes in that area. No real response - just marketing mumbling. So I asked what is the best way to upgrade existing workflow. His response was to make new version of library (DLL) and deploy it as upgrade. Basically he suggested to leave old workflow intact (running workflows will end up on old version). Unexceptable! So I decided from not to use workflows in my solutions anymore.

Back to your problem. I solved similar issues by manually stopping stuck workflows and then restarting them with 'upgraded' instance. Ugly and applicable only for very small quantities.

Sorry that I cannot provide any meaningful answer. I would really be thrilled if this answer receives ton of downvotes and comments in 'you are so stupid, this can be done by..' style.

OTHER TIPS

In the screenshot provided, there is no while loop in your on "task changed", therefore it will only fire the activity once per workflow instance. So, if user changes the task without capturing approval in your if else below, it will be in purgatory.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top