如何将序列放入 Windows 工作流状态机?

发布于 2024-07-26 02:58:27 字数 427 浏览 2 评论 0原文

我有一个 Windows Workflow Foundation (3.0) 状态机,其中我需要某些状态来根据状态的期限更改状态。 例如,当工作流程进入状态 X 时,用户需要在 5 天内执行操作。 如果尚未完成此操作,工作流程需要转换到状态 Y。因此,我认为我想要的是一个具有 EventDriven Activity 来处理用户操作的状态,以及一个带有 Delay 活动的 Sequence 活动,该 Delay 活动具有 SetState 活动,如果用户没有及时执行操作,则会导致状态转换。

状态不直接接受序列活动,因此我尝试将此逻辑放入 StateInitialization 活动中,但它不允许延迟。 我可以将延迟放在前一个状态和另一个 EventDriven 活动中,然后转换到适当的状态,但这并不真正适合业务流程。

有没有办法在状态机中完成此操作,或者我应该使用顺序工作流程?

I have a Windows Workflow Foundation (3.0) state machine in which I need certain states to change state based on the age of the state. For example, when the work flow enters state X the user needs to action it within 5 days. If this has not been done, the work flow needs to transition into state Y. So what I think I want is a state with an EventDriven Activity to handle the user's action, and a Sequence activity with a Delay activity that has a SetState activity which causes the state transition if the user hasn't actioned it in time.

States don't accept a Sequence activity directly, so I have tried to put this logic in the StateInitialization activity, but it doesn't allow Delays. I could put the delay in the previous state and another EventDriven activity and then transition to which ever state is appropriate but that doesn't really fit the business flow.

Is there a way this can be done in State Machines or should I be using a Sequential work flow?

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

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

发布评论

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

评论(1

木槿暧夏七纪年 2024-08-02 02:58:27

您可以使用状态机工作流程轻松实现此目的。

您需要将 StateInitializationActivity 和 EventDrivenActivity 放入您的状态中。 EventDrivenActivity 接受延迟活动,将超时后的逻辑放在那里,例如设置另一个状态。 如果计时器早于 StateInitializationActivity 中的活动到期,则状态将发生更改。

You can achive this using state machine workflows easily.

You need to put a StateInitializationActivity and an EventDrivenActivity into your states. The EventDrivenActivity accepts a delay activity, put the logic after the timeout there, for example set another state. If the timer elapses earlier than the activities within the StateInitializationActivity, the state will be changed.

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