WF4:如何设置工作流程以接收多条消息

发布于 2024-11-09 00:34:23 字数 673 浏览 4 评论 0 原文

我想要一个工作流,它可以从 MSMQ 接收多个相同的消息。

示例:

Receive: CreateWorkflow (CanCreateInstance=True)
Do Something...
Parallel (CompletionCondition=ExitParallel)
    Parallel Branch 1
        Receive: Update (CanCreateInstance=False, Use correlation)
        Process...
    Parallel Branch 2
        Receive: Finish (CanCreateInstance=False, Use correlation)
        Set ExitParallel=True

我希望我的工作流程能够接收多个更新消息。但是,在此设置中,它只能接收 1。根据 这篇 MSDN 帖子,这应该可以工作,但我从来没有让它工作过。

解决方案是在并行分支 1 中放置无限 while 循环吗?还有别的办法吗?

I want a workflow, which can receive multiple of the same message from a MSMQ.

Example:

Receive: CreateWorkflow (CanCreateInstance=True)
Do Something...
Parallel (CompletionCondition=ExitParallel)
    Parallel Branch 1
        Receive: Update (CanCreateInstance=False, Use correlation)
        Process...
    Parallel Branch 2
        Receive: Finish (CanCreateInstance=False, Use correlation)
        Set ExitParallel=True

I would like to have my workflow be able to receive multiple Update messages. However, in this setup, it can only receive 1. According to this MSDN post, this should work, but I never got this to work.

Is the solution to put an infinite while loop in Parallel Branch 1? Is there another way?

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

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

发布评论

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

评论(1

各空 2024-11-16 00:34:23

为了接收多个更新消息,您必须将接收放入循环中。您现在设置的方式允许更新一次,并且并行仅等待第二个分支(带有“完成”)完成。

In order to receive multiple update messages you will have to put that receive in a loop. The way you set it up right now the update is allowed once and the Parallel only waits for the second branch, with the Finish, to complete.

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