取消ELSA的阻止活动
我有3个平行的阻止活动,所有等待触发。当一个触发时,我想取消另一个2(停止另一个两个信号,一旦触发一个信号),例如:
我该如何在代码中执行此操作?说,在加入活动之后,我还有另一个活动将取消其他未触发的两个活动。我不想使用饰面活动,因为那将停止整个工作流程。我要这样做的原因是因为在触发了一个信号后,工作流程简历,如果触发另一个信号,它将返回从触发信号的位置执行。我不希望它触发后返回。
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:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我做了一些挖掘,发现问题正处于我的末端。
信号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 returnsDone()
. 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();
beforereturn Done();