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. Ubuntu 13.04 双显卡安装NVIDIA GT 630M驱动

    [日期:2013-05-24]   Linux系统:Ubuntu 13.04 安装 bumblebee 以管理双显卡,下面命令会自动安装NVIDIA显卡驱动 sudo add-apt-reposito ...

  2. Ajax请求WebService跨域问题 [转载]

    1.背景 用Jquery中Ajax方式在asp.net开发环境中WebService接口的调用 2.出现的问题 原因分析:浏览器同源策略的影响(即JavaScript或Cookie只能访问同域下的内容 ...

  3. 【转】ORATOP工具使用说明

    文章转自:http://lintzyuan.blogspot.jp/2014/07/oratop.html ORATOP   前言:隨著PC Server的規格及速度愈來愈快,大多數的公司摒棄大型主機 ...

  4. HANA Studio中修改默认查询结果只显示1000行

  5. 利用SVN工具下载OpenCore代码

    OpenCore原来使用的是CVS管理代码的.从09年起,更换用SVN管理代码,大家可以用TortoiseSVN软件下载代码,网址是:http://tortoisesvn.net/,安装后tortoi ...

  6. Flex Error #2156问题

    出现这个问题是因为应用程序使用了特殊端口,修改端口就可以解决. 特殊端口列表 A security change has been made in Adobe Flash Player 9.0.115 ...

  7. 笔记——Visual Studio 程序员箴言

    记录了一些感觉比较用得到的tips用于随时查看.要想看完整的的内容还是阅读<Visual Studio 程序员箴言>,不过有些内容我在新版本的VS里没能实现,或者有替代方案了. 避免意外复 ...

  8. Win7以上 32/64位系统隐藏托盘图标

    前两天有朋友找我,让帮忙写个小工具,隐藏windows的托盘图标,想想最近在家也不想做太复杂的事,也好几年没写过windows上的小工具了,就答应了.想来挺简单的事,没想到还是有点小插曲的.特地来博客 ...

  9. Xcode-显示代码行数

    在Xcode菜单中选择Preferences命令,单击Text Editing选项图标,选中Linenumbers复选框.(快捷键苹果键+逗号打开preferences --> Text Edi ...

  10. 浅谈mysql的两阶段提交协议

    前两天和百度的一个同学聊MySQL两阶段提交,当时自信满满的说了一堆,后来发现还是有些问题的理解还是比较模糊,可能是因为时间太久了,忘记了吧.这里再补一下:) 5.3.1事务提交流程 MySQL的事务 ...