在工作流程中实现多线程
我知道单个工作流实例一次在单个线程中运行。我有一个工作流程,其中一个选择活动中有两个接收活动。实现消息关联是为了确保对两个活动的请求应路由到同一实例。
在第一个接收分支中,我有一个并行活动,其中一个分支中有一个延迟活动。并行活动将在延迟结束或标志设置为 true 时完成。
当并行活动等待条件满足时,我如何接收来自第二个接收活动的调用?因为该标志只有通过它的分支才会被设置为 true。我正在等待您的建议或想法。
I'm aware a single workflow instance run in a single thread at a time. I've a workflow with two receive activities inside a pick activity. Message correlation is implemented to make sure the requests to both the activities should be routed to the same instance.
In the first receive branch I've a parallel activity with a delay activity in one branch. The parallel activity will complete either the delay is over or a flag is set to true.
When the parallel activity is waiting for the condition to meet how I can receive calls from the second receive activity? because the flag will be set to true only through through it's branch. I'm waiting for your suggestions or ideas.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看我的博客 工作流并行活动和任务并行 这将帮助您了解 WF 的工作原理
Check out my blog The Workflow Parallel Activity and Task Parallelism This will help you understand how WF works
不太确定你想在这里实现什么目标。
如果您有一个具有 2 个分支的 Pick,并且两个分支都包含一个 Receive,则在您收到 2 个 Receive 活动正在等待的 2 条消息中的一条消息后,它将继续。另一个将被取消并且不会收到任何东西。一个接收是并行的这一事实在这里不会产生影响。因此,除非这是一个循环,否则您在工作流中不会收到多于一条 WCF 消息。
Not quite sure what you are trying to achieve here.
If you have a Pick with 2 branched and both branches contain a Receive it will continue after you receive either of the 2 messages the 2 Receive activities are waiting for. The other will be canceled and not receive anything. The fact that one Receive is in a Parallel will not make a difference here. So unless this is on a loop you will not receive more than one WCF message in your workflow.