工作流程:如何向并行活动的一个分支发出信号以从另一分支结束?

发布于 2024-08-23 16:40:36 字数 192 浏览 4 评论 0原文

我有一个具有并行活动的工作流程,其中一个分支工作,另一个分支有一个可以关闭工作流程的接收活动(是使用 HandleExternalEvent 执行此操作的正确方法吗?)。当然,问题在于,如果从未调用接收活动,则工作分支将完成并等待接收活动分支。如何向另一个分支发出信号以关闭活动?我尝试过使用监听活动来保存接收活动和自定义事件活动,但我也缺少一些关于如何使其工作的信息。

I have a workflow with a parallel activity, where one branch does work and the other has a receive activity that can shut the workflow down (is the proper way to do this with a HandleExternalEvent instead?). The problem, of course, is that if the receive activity is never called, the work branch completes and waits on the receive activity branch. How can I signal the other branch to close the activity? I've toyed a bit with using a listen activity to hold the receive activity and a custom event activity, but I'm missing something on how to make that work, as well.

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

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

发布评论

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

评论(2

明明#如月 2024-08-30 16:40:36

您可以使用“CompletionCondition”,它是一个并行活动属性,指示如果分支结束,并行活动是否必须完成。

您可以检查它 此处

You can use 'CompletionCondition", which is a parallel activity property that indicates whether parallel activity must finish if a branch ends.

You can check it here

怎樣才叫好 2024-08-30 16:40:36

您可以使用 ActivityExecutionContext 对象上的 CancelActivity 方法取消备用分支上的侦听活动:

http://msdn.microsoft.com/en-us/library/system.workflow.componentmodel.activityexecutioncontext.cancelactivity.aspx

You could cancel the listening activity on the alternate branch using the CancelActivity method on the ActivityExecutionContext object:

http://msdn.microsoft.com/en-us/library/system.workflow.componentmodel.activityexecutioncontext.cancelactivity.aspx

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