This problem generally start when you are having an existing custom workflow and there are instances of workflow running. You do some changes to the workflow and reinstall the assembly in the GAC. The new assembly is basically overwriting the existing one (it has same signature). When you try to complete the existing workflow instances after updating the assembly, you may get "Task is locked by running workflow instance" error or it just hangs in "In Progress" state.

So what did happen in background?

The public interface of the workflow, which has been serialized in the database, have changed and now the new assembly does not know how to de-serialize the workflow data from the database. At this point the workflow will fail as it is unable to serialize the current state and looks like it hanged in "In Progress" state.

Then how should I upgrade the assembly for a workflow?

Upgrading running instances of a workflow is a tricky business because the workflow doesn't know, if it's current state is, before or after a change in the assembly. When anything changes in public interface of workflow assembly, serialization/de-serialization of workflow data fails. The new assembly of workflow does not know how to load the older serialized data.

If you are just changing the code logic within the methods, you should be able to update the workflow assembly without breaking the existing workflow instances. But if you add/remove/modify any activity or add/remove any properties/methods from the code and update the existing workflow assembly, that would break the existing instances.

In nutshell, any kind of changes to the interface (public code interface or workflow design interface, which is serialized) will break the workflow.

The suggested way to upgrade the workflow is to create a new version of workflow and install it in GAC and SharePoint. Mark the existing workflow to "No New Instance", which will not create any new instances of old workflow.
Use the new workflow assembly for new instances, and the old workflow assembly for old instances. To do this, you need to update the assembly version to the next one (e.g. 2.0 from 1.0) and adjust the workflow.xml file to point to 2.0, then keep both 1.0 and 2.0 in the GAC. When you reinstall, new instances will use that new version, and old instances will continue to use the old and when all the older workflow instances have finished, you can remove the 1.0 version from the server.

How to upgrade workflow assembly in MOSS 2007的更多相关文章

  1. Custom Web Servic In MOSS 2007

    Tools: Visual Studio 2008,Visual Studio 2008 Command Prompt, Sharepoint Server 2007 Generate .disco ...

  2. Create and Install Timer Job in MOSS 2007

    Excute Timerjob public class TriggerLoadCacheTimerJob : SPJobDefinition { string ExceptionFlag = str ...

  3. MOSS 2007 错误0x80040E14解决

    今天公司内网莫名的出现错误,只能新建列表条目,不能创建网站,到后来列表条目也不能创建了,一直报0x80040E14错误.于是Google一把,搜索这个错误号,然后在apearce 的Blog找到了原因 ...

  4. Upgrade custom workflow in SharePoint

    Experience comes when you give a try or do something, I worked in to many SharePoint development pro ...

  5. sharepoint mysite and upgrade topics

    My Sites overview (SharePoint Server 2010)http://technet.microsoft.com/en-us/library/ff382643(v=offi ...

  6. SharePoint 2007 页面定制(一)

    转:http://www.nanmu.net/SharePoint-MOSS-WSS-Silverlight/Lists/Posts/Post.aspx?ID=74 本文主要包括以下几方面内容: 1. ...

  7. Windows SharePoint Services 3.0编码开发工具和技巧(Part 1 of 2)

    转:http://blog.csdn.net/mattwin/article/details/2074984 WSSv3 Technical Articles_Windows SharePoint S ...

  8. 我大中华微软MVP中国区人才库

    刘海峰:国内知名微软开源技术网站51Aspx 创始人,十年以上的Asp.net从业经验,微软MSDN特约讲师.Teched讲师.ImagineCup大赛评委.人大出版社研修班特约讲师,曾多次受邀访问美 ...

  9. Sharepoint学习笔记—习题系列--70-576习题解析 -(Q141-Q143)

    Question  141 You are planning an upgrade to a SharePoint 2010 application. You have the following r ...

随机推荐

  1. Oracle---.oracle函数

    数值型函数: 绝对值: ABS(x) [功能]返回x的绝对值 [参数]x,数字型表达式 [返回]数字 [示例] select abs(100),abs(-100) from dual;-------- ...

  2. annotation:@Override出现The method of type must override asuperclass解决方案

    原因追踪及解决办法: 1. 查阅资料发现说在jdk1.5下要使用@Override这个annotation必须保证被标注的方法来源于class而不是interface. 2. 即使自己的jdk是1.6 ...

  3. android xml 常用控件介绍

    android常用控件介绍 ------文本框(TextView)     ------列表(ListView)     ------提示(Toast)     ------编辑框(EditText) ...

  4. C#基础总结之二循环控制-运算符

    #region 第二天 作业2 从键盘上输入三个数,用if语句和逻辑表达式把最小数找出来. //需要:控制台输入 三个变量(a,b,c)判断这三个数其中一个最小的值 打印输出 //Console.Wr ...

  5. Web Component--01. 简介

    Web Components 是什么? Web Components是W3C定义的新标准,它给了前端开发者扩展浏览器标签的能力,可以自由的定制组件,更好的进行模块化开发,彻底解放了前端开发者的生产力. ...

  6. 菜鸟学Windows Phone 8开发(3)——布局和事件基础

    本系列文章来源MSDN的 面向完全新手的 Windows Phone 8 开发  本文地址:http://channel9.msdn.com/Series/Windows-Phone-8-Develo ...

  7. 简单的session共享的封装

    目的 session存储在缓存服务器上(各种缓存服务器上均可,本文以memcached为例),但对开发者来说,他不用关注,只需要调用request.getSession()方法即可获取到session ...

  8. 实用手册:130+ 提高开发效率的 vim 常用命令

    Vim 是从 vi 发展出来的一个文本编辑器.代码补完.编译及错误跳转等方便编程的功能特别丰富,在程序员中被广泛使用.和 Emacs 并列成为类 Unix 系统用户最喜欢的编辑器.这里收录了130+程 ...

  9. web前端学习路线与书籍推荐

    什么是web前端? 在以前,通俗的讲是网页制作,在现在,哼哼,可以参考这篇文章 http://tieba.baidu.com/p/4817153404 那么如果高效优雅的学习web呢? 注:以下纯属个 ...

  10. UNIQUEIDENTIFIER列上的统计信息

    UNIQUEIDENTIFIER列上的统计信息非常有意思,在它上面有一些很令人讨厌的行为.我们来看下. 问题重现(The repro) 为了向你展示我们刚抱怨的行为,我用下列简单的表定义创建了一个数据 ...