WF:确定工作流程是否完成

发布于 2024-08-13 05:29:40 字数 160 浏览 1 评论 0原文

除了订阅 WorkfloRuntime 的 WorkflowCompleted 事件之外,如何从主机确定工作流实例是否已完成?是否有任何标志或状态可以检查给定的 WorflowInstance 以确定它是否已完成?

@Edit:问题是关于顺序工作流程的。

How do I determine from the host if a workflow instance has compled or not besides subscribing to the WorkfloRuntime's WorkflowCompleted event? Is there any flag or state I can check for a given WorflowInstance to determine if it has completed?

@Edit: The question is about sequential workflows.

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

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

发布评论

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

评论(2

讽刺将军 2024-08-20 05:29:40

您可以检查 TrackingServices 以了解工作流实例的当前状态。

这里有一些代码片段: .NET 3.0
Windows 工作流中的状态机

You can to check TrackingServices to know what current state for a workflow instance.

There are some code snippets here: .NET 3.0
State Machines In Windows Workflow
.

掩于岁月 2024-08-20 05:29:40

答案(至少据我所知)是没有与 WorkflowInstance 关联的标志,您可以为给定实例检索该标志来指示该实例是否已完成。

可用的两种方法是:

  1. WorkflowRuntime.WorkflowCompleted 事件

  2. 使用TrackingService 服务用于保存工作流执行的“日志”并查询日志以确定工作流实例是否已完成。这是一篇很好的介绍性文章。通过这种方法,TrackingService 唯一可用的现成实现是 SqlTrackingService,需要 SQL Server 数据库。然后,您可以使用 SqlTrackingQuery 来使用

注意:SqlTrackingService 行为的一个有趣的方面是,默认情况下它不会立即将从运行时接收到的消息写入数据库,但仅限于交易结束时。此行为由 IsTransactional SqlTrackingService 的属性。

The answer (at least for know, from what I've learned) is that there's no flag associated with a WorkflowInstance that you can retrieve for a given instance indicating whether the instance has completed.

The two approaches available are:

  1. WorkflowRuntime.WorkflowCompleted Event

  2. Using a TrackingService service to keep a 'log' of workflow execution and quering the log to destermine if a workflow instance has completed. Here is a good introductory article. With this approach the only available out-of-the-box implementation of TrackingService is SqlTrackingService, which requires a SQL Server database. You can then use SqlTrackingQuery to query the 'log'

Note: An interesting aspect of the behaviour of SqlTrackingService is that it won't by default immediatly write the messages it receives from the runtime to the database, but only at the end of transactions. This behaviour is controlled by IsTransactional property of SqlTrackingService.

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