工作流程和异常处理
在开发将执行大量工作项的自定义工作流时,一个或多个工作项可能在其例程期间随时失败,甚至可能引发异常。
在处理工作流管理器内的工作项引发的异常时,最佳实践是什么?
例如,工作流管理系统是否应该简单地记录错误,然后立即终止?工作流管理器是否应该简单地记录异常并继续执行其他工作项?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想说这非常依赖于上下文。
当然,步骤 1 失败后一定不能执行步骤 2 吗?
可能一些价格检查的失败不应妨碍整体完成。
我认为你至少需要启用
and
但这变得非常棘手。您可能需要启用补偿(撤消之前的工作)。例如,预订酒店,尝试预订航班 - 失败,嗯,仅仅中止还不够,我们还需要取消预订该酒店。
您可能还需要启用
I would say that this is very context dependent.
Surely a failure of step 1 must not be followed by execution of step 2?
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
and
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