2

我有一个正在运行的工作流,它同时使用了 parallell 和 OnTaskCreated 活动。该解决方案已部署在多个客户端,我最近正在进行升级,需要更换工作流程序集。升级时,我在服务器上有一些正在运行的工作流实例。

从那以后没有任何工作,我似乎无法正常完成新的工作流程。我总是在这里收到此错误:

01/14/2010 16:14:33.73  w3wp.exe (0x1928)                           0x2514  Windows SharePoint Services     Workflow Infrastructure         936l    High        Engine RunWorkflow: System.Workflow.Activities.EventDeliveryFailedException: Event "OnTaskChanged" on interface type "Microsoft.SharePoint.Workflow.ITaskService" for instance id "7697ee64-7286-46f3-992e-cf3c18731f15" cannot be delivered. ---> System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.Workflow.SPWorkflowHostServiceBase.LoadInstanceData(Guid instanceId, Boolean& compressedData)     at Microsoft.SharePoint.Workflow.SPWinOePersistenceService.LoadWorkflowInstanceState(Guid instanceId)     at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance)     at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationCont...  
01/14/2010 16:14:33.73* w3wp.exe (0x1928)                           0x2514  Windows SharePoint Services     Workflow Infrastructure         936l    High        ...ext context, WorkflowInstance workflowInstance)     at System.Workflow.Runtime.WorkflowRuntime.GetWorkflow(Guid instanceId)     at System.Workflow.Activities.WorkflowMessageEventHandler.EventHandler(Object sender, ExternalDataEventArgs eventArgs)     --- End of inner exception stack trace ---     at System.Workflow.Activities.WorkflowMessageEventHandler.EventHandler(Object sender, ExternalDataEventArgs eventArgs)     at Microsoft.SharePoint.Workflow.SPWinOETaskService.RaiseEvent(SPWinOeWorkflow workflow, SPWorkflowEvent workflowEvent, Object workItem, IPendingWork workHandler)     at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e)     at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService ho...   
01/14/2010 16:14:33.73* w3wp.exe (0x1928)                           0x2514  Windows SharePoint Services     Workflow Infrastructure         936l    High        ...st, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)   

我一直在用谷歌搜索这个问题,我发现了多种解决方案,人们建议在升级之前终止所有工作流实例。在我看来,该解决方案是不可接受的,因为我可能拥有无法管理的运行工作流数量。

我想知道这是否可能与 Sharepoint Workflow Host 有关,我可以在升级期间以编程方式终止所有正在运行的工作流吗?

有人知道我该如何解决这个问题吗?

4

1 回答 1

3

你应该听那些人的话,或者至少自己调查一下他们为什么要说这些话。他们是对的,现在你知道为什么了;您已经有效地搞砸了所有正在运行的工作流程。

当工作流不活动/空闲和/或等待事件时,SharePoint 将二进制工作流序列化到数据库。如果在程序集处于休眠/序列化状态时换出程序集,当 sharepoint 中的 WF 托管基础结构尝试反序列化工作流以恢复它时,它将失败,因为目标类型已更改(因为您“升级”了它。)

在 sharepoint 中升级二进制工作流没有简单的方法;并排是唯一可行的方法。您提升程序集版本,创建新的 WF 关联并设置旧的 wrkflow 关联以停止接受新请求。旧工作流程将使用旧代码完成,新工作流程使用您的新代码。没办法,对不起。

-Oisin

于 2010-01-16T21:58:27.670 回答