取消ELSA的阻止活动

发布于 2025-01-28 04:12:07 字数 327 浏览 5 评论 0原文

我有3个平行的阻止活动,所有等待触发。当一个触发时,我想取消另一个2(停止另一个两个信号,一旦触发一个信号),例如:

WorkFlow Image

我该如何在代码中执行此操作?说,在加入活动之后,我还有另一个活动将取消其他未触发的两个活动。我不想使用饰面活动,因为那将停止整个工作流程。我要这样做的原因是因为在触发了一个信号后,工作流程简历,如果触发另一个信号,它将返回从触发信号的位置执行。我不希望它触发后返回。

I have 3 blocking activities sitting in parallel all waiting to be triggered. I'd like to cancel the other 2 when one is triggered (stop the other 2 from expecting a signal once one has been triggered), like this:

workflow image

How can I do that in code? Say, after the Join activity, I have another activity that will cancel the other two that were not triggered. I don't want to use the Finish activity because that will stop the whole workflow. The reason I want to do this is because after one of the signals has been triggered the workflow resumes and if another signal is triggered it goes back to execute from where the signal is triggered. I do not want it to go back after one has been triggered.

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

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

发布评论

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

评论(1

2025-02-04 04:12:07

我做了一些挖掘,发现问题正处于我的末端。

信号1 是一种自定义阻塞活动。在onexecuteasync方法中,有一个条件返回done()。因此,在这种情况下,活动不会被暂停并等待触发器。

因此,为了解决我添加的行:
context.workflowinstance.scheduledactivitivities.clear(); 返回完成();>

I did a bit of digging and discovered that the issue was on my end.

Signal 1 is a custom blocking activity. Inside the OnExecuteAsync method there is a condition that returns Done(). So in this case the activity does not get suspended and wait for a trigger.

So, to fix that I added the line:
context.WorkflowInstance.ScheduledActivities.Clear(); before return Done();

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