ASP.NET MVC 中的 InvalidOperationException 和工作流
我正在尝试使用 ASP.NET MVC 中的 StateMachineWrokflowInstance 查询正在运行的状态机工作流。
以下是场景:
工作流运行时配置:添加了
SqlWorkflowPersistenceService
、ManualWorkflowSchedulerService
、ExternalDataExchangeService
和注册的自定义ExternalDataExchange
具有ExternalDataExchangeService
的服务;执行顺序:
var instance = WorkflowRuntimeHandle.CreateWorkflow(type); 实例.Start(); WorkflowRuntimeHandle.GetService
().RunWorkflow(实例.InstanceId); var stateMachineWorkflowInstance = new StateMachineWorkflowInstance(实例.WorkflowRuntime, 实例.InstanceId); 收到错误:
System.InvalidOperationException:在以下位置找不到 ID 为“[GUID]”的工作流 状态持久存储?
我做错了什么?
I'm trying to query a running state machine workflow using StateMachineWrokflowInstance
in ASP.NET MVC.
Here is the scenario:
Workflow runtime configuration: added
SqlWorkflowPersistenceService
,ManualWorkflowSchedulerService
,ExternalDataExchangeService
and registered customExternalDataExchange
service withExternalDataExchangeService
;Execution sequence:
var instance = WorkflowRuntimeHandle.CreateWorkflow(type); instance.Start(); WorkflowRuntimeHandle.GetService<ManualWorkflowSchedulerService> ().RunWorkflow(instance.InstanceId); var stateMachineWorkflowInstance = new StateMachineWorkflowInstance(instance.WorkflowRuntime, instance.InstanceId);
Received error:
System.InvalidOperationException: Workflow with id "[GUID]" not found in state persistence store?
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然这个异常可能有很多原因。
我找到了一种方法来找出罪魁祸首。
我为所有工作流运行时事件添加了处理程序,并将序列作为历史记录存储在列表中,并从列表中发现,在调用
RunWorkflow
后,工作流被终止。WorkflowTermminate
事件参数WorkflowTermulatedEventArgs
附带一个Exception
属性,其中包括显示问题真正根源的内部异常。我把这篇文章贴在这里,希望这篇文章对正在阅读的人有所帮助。
Apparently this exception could have many causes.
I found a way to detect the culprit.
I added handlers for all the workflow runtime events and stored the sequence as history in a list and discovered from the list that after
RunWorkflow
is called the workflow was terminated.The
WorkflowTerminated
event parameterWorkflowTerminatedEventArgs
comes with aException
property which includes inner exceptions that showed the real source of the problem.I'm posting this here in hope that this experience would be beneficial to those who are reading.