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.

最新文章

  1. [课程设计]Scrum 1.7 多鱼点餐系统开发进度(点餐菜式内容添加及美化)
  2. for 与 foreach 性能
  3. cookie与session的区别与联系
  4. [转载]Dotfuscator Professional Edition 4.9.7500.9484 混淆工具破解版+使用教程
  5. 8000401a错误解决方式(Excel)
  6. Scala-数组
  7. du与df为什么有时候会有差异
  8. POJ2553-The Bottom of a Graph
  9. TFS的安装
  10. Swift字符串可变性
  11. 鸟哥的linux私房菜学习-(四)linux命令的基本概念
  12. CF487 E. Tourists [点双连通分量 树链剖分 割点]
  13. MongoDB 中数据的替换方法实现 --类Replace()函数功能
  14. 异常处理器详解 Java多线程异常处理机制 多线程中篇(四)
  15. Chapter 4 Invitations——6
  16. jQuery筛选总结
  17. day2_Jmeter压测
  18. 教你使用SQL数据库复制系列(1-7)
  19. 2.11 C++转型构造函数
  20. 阿里云直播服务 sdk demo php

热门文章

  1. Linux/Ubuntu sudo不用输入密码的方法
  2. 二十七、EFW框架BS系统开发中的MVC模式探讨
  3. Python Shell 解释器下使用Django Model
  4. php生成随机密码(php自定义函数)转自先锋教程网
  5. Java Web学习系列——创建基于Maven的Web项目
  6. poj 1474 Video Surveillance - 求多边形有没有核
  7. 【解决方案】VS2013外部工具中添加ildasm.exe
  8. [OpenCV] Image Processing - Grayscale Transform
  9. [转]AutoResetEvent 与 ManualResetEvent区别
  10. linux内核分析课程笔记(二)