工作流程和异常处理

发布于 2024-08-07 18:45:57 字数 171 浏览 3 评论 0原文

在开发将执行大量工作项的自定义工作流时,一个或多个工作项可能在其例程期间随时失败,甚至可能引发异常。

在处理工作流管理器内的工作项引发的异常时,最佳实践是什么?

例如,工作流管理系统是否应该简单地记录错误,然后立即终止?工作流管理器是否应该简单地记录异常并继续执行其他工作项?

In developing a custom workflow that will execute numerous work items, it is possible that one or more workitems could fail at any time during their routines and even perhaps raise exceptions.

What is best practice when it comes to handling exceptions raised by workitems inside a workflow manager?

For instance, should the workflow management system simply just log the error and then die outright? Should the workflow manager simply log the exception and carry on with execution of other workitems?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瀟灑尐姊 2024-08-14 18:45:57

我想说这非常依赖于上下文。

Pack parcel

Dispatch parcel

当然,步骤 1 失败后一定不能执行步骤 2 吗?

Check price with vendor A
Check price with vendor B
...
Check price with vendor Z

Buy cheapest

可能一些价格检查的失败不应妨碍整体完成。

我认为你至少需要启用

Park this for human intervention

and

Sorry your request could not be actioned. 

但这变得非常棘手。您可能需要启用补偿(撤消之前的工作)。例如,预订酒店,尝试预订航班 - 失败,嗯,仅仅中止还不够,我们还需要取消预订该酒店。

您可能还需要启用

That failed, I'll retry a little later.

I would say that this is very context dependent.

Pack parcel

Dispatch parcel

Surely a failure of step 1 must not be followed by execution of step 2?

Check price with vendor A
Check price with vendor B
...
Check price with vendor Z

Buy cheapest

Proabably a failure of a few of the price checks shouldn't prevent the overall completion.

I think you will need to enable at least

Park this for human intervention

and

Sorry your request could not be actioned. 

But this gets very tricky. You may need to enable compensation (undoing previous work). For example Book Hotel, try to book flight - fails, hmm not enough just to abort we also need to unbook that hotel.

You may also need to enable

That failed, I'll retry a little later.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文