Workflow id为“的工作流”;xxxxx";在状态持久性存储中找不到
我有一个工作流应用程序,当我尝试使用ExternalDataExchangeService调用事件时会抛出错误 在状态持久性存储中找不到id为“866568ab-ca1b-4404-a2f1-2c8704539ef4”的工作流 无法传递实例id为“866568ab-ca1b-4404-a2f1-2c8704539ef4”的接口类型“RecipeChangeService.IRecipeChangeService”上的事件“QAEngOrTLReject” 以下是我的it实施代码-请帮助我解决问题:( 下面是接口和数据交换事件参数-Workflow id为“的工作流”;xxxxx";在状态持久性存储中找不到,workflow,workflow-foundation,Workflow,Workflow Foundation,我有一个工作流应用程序,当我尝试使用ExternalDataExchangeService调用事件时会抛出错误 在状态持久性存储中找不到id为“866568ab-ca1b-4404-a2f1-2c8704539ef4”的工作流 无法传递实例id为“866568ab-ca1b-4404-a2f1-2c8704539ef4”的接口类型“RecipeChangeService.IRecipeChangeService”上的事件“QAEngOrTLReject” 以下是我的it实施代码-请帮助我解决问题
public class RecipeChangeService : IRecipeChangeService{
#region IRecipeChangeService Members
public event EventHandler QAEngOrTLApprove;
public event EventHandler QAEngOrTLReject;
public bool QAEngOrTLApproved(Guid instanceId, ResponseDataObject rdo) {
if (QAEngOrTLApprove != null) {
QAEngOrTLApprove(this, new XMESWFRecipeResponseDataEventArgs(rdo, instanceId));
return true;
}return false;
}
public bool QAEngOrTLRejected(Guid instanceId, ResponseDataObject rdo) {
if (QAEngOrTLReject != null) {
QAEngOrTLReject(this, new XMESWFRecipeResponseDataEventArgs(rdo,instanceId));
return true;
} return false;
}
}
[Serializable]
public class XMESWFRecipeResponseDataEventArgs : ExternalDataEventArgs {
public readonly ResponseDataObject rdo = null;
public XMESWFRecipeResponseDataEventArgs(ResponseDataObject rdo, Guid instanceId)
: base(instanceId)
{
this.rdo = rdo;
}
}
事件是使用-
IRecipeChangeService s =
ExceptionServices.GetExceptionService(WorkflowExceptionType.RecipeChange)
as IRecipeChangeService;
s.QAEngOrTLApproved(new Guid(instanceId), rdo);
谢谢。帮个忙,请确保代码可读
找不到工作流可能有很多原因。首先,如果没有持久性服务且工作流不在内存中,您也会看到此错误。另一件要检查的事情是工作流是否尚未完成。这可能是由于其他事件或未经处理的错误造成的。我添加了persi声明式模具服务。如何确保其正常工作。我确定工作流在内存中且未完成。打开保存工作流的数据库并检查InstanceState表。每个已知工作流都应有一条记录。您可以使用GetLoadedW检查工作流是否在内存中工作流()函数。如果不存在,则可能使用了错误的工作流InstanceId,或者可能有多个工作流运行时,并且使用了与启动工作流时不同的运行时。My InstanceState表为空。这意味着没有持久化workflow。如何确保实例何时通过持久化服务保存到数据库。如果设置Unlow将SqlWorkflowPersistenceService上的adOnIdle选项设置为true,它将在任何工作流空闲时将其持久化。因此,使用DelayActivity将使其空闲并持久化。或者,使用WorkflowInstance.Unload()命令函数手动卸载它。我忘了提到的一点是,工作流运行时将只转到SqlWorkflowPersistenceService,因为指定的workflow不在内存中。因此,从您最初的问题判断,您可能从错误的角度看待此问题。您从何处获取工作流实例ID,以及它是否是有效的工作流实例那么它发生了什么?