工作流程应用程序中央错误处理

编程入门 行业动态 更新时间:2024-10-27 14:20:27
本文介绍了工作流程应用程序中央错误处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是在使用WorkflowApplication托管我们的工作流的情况下.

This is in the context of using WorkflowApplication to host our workflows.

我们有许多错误状态,这些错误状态本质上是瞬态的(Web服务网站已关闭,Web服务行为不正确,数据库超时等).我们希望能够恢复由于某些时候其中一个错误而失败的工作流 将来当瞬态问题得到纠正后.

We have a number of error states that are transient in nature (web service website is down, web service is behaving incorrectly, database timeout, etc). We'd like the ability to resume workflows that failed because of one of those errors at some point in the future when the transient problem has been corrected.

我的初步研究表明WorkflowApplication不支持此功能:OnUnhandledException没有"Suspend"值.或类似内容-只是中止,取消,终止. OnUnhandledException的文档说:

My initial research indicates that WorkflowApplication doesn't support this: OnUnhandledException doesn't have a value for "Suspend" or similar -- just Abort, Cancel, Terminate. The docs for OnUnhandledException say this:

"和" OnUnhandledException 和 WorkflowUnhandledExceptionBehavior 规定了工作流中未处理异常时的运行时行为.然而, WorkflowUnhandledExceptionBehavior 可以选择将暂挂的工作流保留在持久性存储中,而 OnUnhandledException 确实不是.这样做的原因是,挂起的工作流程会发生特定于主机的情况, 和 WorkflowApplication 不是.要实现此功能,请使用 WorkflowApplication ,创建一个风俗 PersistenceParticipant 具有这种行为."

"Both OnUnhandledException and WorkflowUnhandledExceptionBehavior dictate the behavior of the runtime when an exception is not handled in the workflow; however, WorkflowUnhandledExceptionBehavior has the option of leaving a suspended workflow in the persistence store, while OnUnhandledException does not. The reason for this is that what happens to a suspended workflow is host-specific, and WorkflowApplication is not. To implement this functionality using WorkflowApplication, create a custom PersistenceParticipant that has this behavior."

我查看了PersistenceParticipant文档,但这并不是完全有用.

I've looked over the PersistenceParticipant documentation, but it's not exactly useful.

那么,这些问题:

1)这是处理在未处理的异常上挂起"的方法吗?在WorkflowApplication中?如果没有,那是什么?

1) Is this the way to go about handling "Suspend on unhandled exception" in a WorkflowApplication? If not, what is?

2)如果是,我该如何暂停/取消暂停失败的实例?

2) If it is, how would I suspend/unsuspend a failed instance?

推荐答案

最好的选择是设置状态会因未处理的异常而中止,因为中止的实例仍然可以重新加载.

The best bet is to set the state to abort on Unhandled Exception because an aborted instance can still be reloaded.

如果持久性是通过书签完成的,则只需恢复书签即可.

If the persistence is done by bookmarks, you can simply resume the bookmark..

或者,如果您使用任何临时持久性存储,则可以调用WorkflowApplication.Load(workflowInstanceId)从上一个持久性存储点重新加载先前中止的工作流.

Orif you useanyad-hoc persist, thenyou can call WorkflowApplication.Load(workflowInstanceId) to reload a previous aborted workflow from its last persisted point.

更多推荐

工作流程应用程序中央错误处理

本文发布于:2023-11-23 08:55:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620838.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   工作流程   错误   中央

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!