如何在StateActivity中添加并行活动?

发布于 2024-07-28 10:23:50 字数 216 浏览 7 评论 0原文

我有一个状态机工作流程。 状态机工作流程需要 EventDriven 活动,

该状态需要等待两个事件的集合,即事件(A1 或 A2)和事件(B1 或 B2)。 总共有四个事件处理程序

可以任意组合,但我的状态应该等待至少两个事件处理程序被引发。 我想过使用 ParallelActivity,但我不能直接在状态机内使用它。

有任何指示可以实现这一目标吗?

I have a State machine workflow. State Machine workflow requires EventDriven activity ,

This state needs to wait for set of two event, that is Either event (A1 or A2) And event (B1 or B2). In total there are four event handlers

In any combination, but my state should wait for at least two to be raised. I thought of using ParallelActvivity, but I cant use it directly inside state machine.

Any pointers to achieve this?

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

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

发布评论

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

评论(1

ま昔日黯然 2024-08-04 10:24:15

最实用的方法是添加 4 个布尔变量,我们将它们称为 A1Fired、A2Fired、B1Fires 和 B2Fires。 现在,在每个 EventDrivenActivity 中设置适当的变量并使用 SetStateActivity 重新激活相同的状态。 最后添加一个 StateInitialization 事件并检查设置了哪些变量,如果是,则执行您需要执行的操作,例如切换到下一个状态。

The most practical way of doing this would be to add 4 boolean variables, lets call them A1Fired, A2Fired, B1Fires and B2Fires. Now in each EventDrivenActivity set the appropriate variable and use a SetStateActivity to reactivate the same state. Finally add a StateInitialization event and check which of the variables are set and if so do whatever you need to do like switch to a next state.

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