WF 4 中工作流 InstanceId 的关联

发布于 2024-10-02 23:52:41 字数 364 浏览 0 评论 0原文

在 .NET 4.0 下的 Windows Workflow Foundation 中,是否有一种方法可以根据长期运行的持久工作流的 InstanceId (GUID) 关联操作?

例如:

  1. 操作 1 创建工作流实例,将工作流实例 ID 返回给客户端
  2. 客户端稍后可以查询 InstanceStore 数据库以从实例视图检索 InstanceId
  3. 客户端调用操作 2 并传递 InstanceId 以进行基于内容的关联

如果我有客户端,我可以执行所有这些操作创建 GUID 并将其传递给第一个操作,在基于内容的关联中使用该值,然后在持久化时提升该值。但这似乎是多余的,因为工作流程已经为实例创建了 GUID。

In Windows Workflow Foundation under .NET 4.0, is there a way to correlate operations based on the InstanceId (GUID) of a long-running persisted workflow?

For example:

  1. Operation 1 creates workflow instance, returns workflow instance ID to client
  2. Client may later query InstanceStore database to retrieve InstanceId from Instances view
  3. Client calls Operation 2 and passes InstanceId for content-based correlation

I can do all of this if I have the client create and pass a GUID to the first operation, use that value in content-based correlation, then promote that value when persisting. That seems redundant, though, since the workflow is already creating a GUID for the instance.

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

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

发布评论

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

评论(1

烏雲後面有陽光 2024-10-09 23:52:41

创建一个活动以从传入的上下文中检索工作流实例 ID,并从 SendReply 活动返回该 ID。接下来使用 SendReply 上的 CorrelationInitializer 来设置请求关联。

Create an activity to retrieve the workflow instance Id from the context passed in and return this from the SendReply activity. Next use the CorrelationInitializer on the SendReply to setup the request correlation.

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