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. jQuery浏览器差异

    //firefox Interface.send(data,function(msg){ $(msg).find("CARINFO").each(function(i){ var ...

  2. Material Design UI Widgets

    Android L 开发者预览支持库提供两个新的Widgets,RecyclerView和CardView.使用这两个Widgets可以显示复杂的Listview和卡片布局,这两个Widgets默认使 ...

  3. [转]查看手机已经记住的WIFI密码

    有时用过wifi后记住密码了,但再想知道wifi密码是多少,怎么办呢.下面的方法为你解决这样的问题. 1.手机必须取得root权限. 2.用RE管理器或es文件浏览器进入data/misc/wifi, ...

  4. MyBatis知多少(20)MyBatis读取操作

    上篇展示了如何使用MyBatis执行创建操作表.本章将告诉你如何使用MyBatis来读取表. 我们已经在MySQL下有EMPLOYEE表: CREATE TABLE EMPLOYEE ( id INT ...

  5. [Python] Debugger in Pycharm

    From: http://blog.csdn.net/u013088062/article/details/50214459 From: http://blog.csdn.net/u013088062 ...

  6. github神器--Atom编辑器初体验

    Atom 1.0正式式版已经出来好几天,自从听说github出了这神器之后,一直想体验一吧,这两天终于体验上. 下载: https://atom.io/ 其实,我的网速还不错,但总是下载到一半就没网速 ...

  7. LeetCode——Jump Game

    Description: Given an array of non-negative integers, you are initially positioned at the first inde ...

  8. 基于.NET C#的 sqlite 数据库 ORM 【Easyliter】

    因为工作原因经常用到SQLITE数据库,但又找不到好用的ORM所以自个整理了一个简单好用的轻量极ORM框架:Easyliter 功能介绍: 1.支持SQL语句操作 2.支持 List<T> ...

  9. Tools Function

    public static void TraceLog(string message, string logFileName) { string tmppath = AppDomain.Current ...

  10. FXForms,自动生成iOS表单

    1.简介 FXForms是一个简单的表单提交框架,他的作者是鼎鼎大名的 Nick Lockwood,你也许听说过他的其他的一些框架,比如 iCarousel. 为什么使用FxForms? 表单处理简单 ...