Windows Workflow Foundation - 安排活动在特定时间运行 [英] Windows Workflow Foundation - schedule activities to run at certain times

查看:62
本文介绍了Windows Workflow Foundation - 安排活动在特定时间运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在评估 WF 是否适合我正在进行的设计.我正处于一个先有鸡还是先有蛋的难题中,我不想投入太多时间来学习所有细节,直到我知道它是否合适为止.

I'm evaluating whether WF would be a good fit for a design I'm working on. I'm in that chicken-and-egg conundrum where I don't want to invest too much time in learning all the details until I have a good idea that it's going to be suitable.

我似乎找不到太多可能很重要的一件事是日程安排.我的意思是将活动安排在某个时间开始.

The one thing that I can't seem to find much on that could be significant is scheduling. And by that I mean scheduling of activities to start at a certain time.

例如我有一个工作流,在开始时执行前两个活动 - 但必须等到第二天早上 9 点才能继续.

E.g. I have a workflow that, on starting, executes the first two activities - but then must wait until, say, 9am the next day before continuing.

我意识到我可以通过将其拆分为两个工作流来实现相同的效果 - 第二个工作流由计划任务触发.但这首先会失去工作流带来的许多好处 - 例如活动之间状态的无缝持久性和保证排序.

I realise I could achieve the same effect by splitting this into two workflows - with the second triggered by, say, a scheduled task. But that would lose much of the benefits of having workflows in the first place - such as seamless persistence of state between activities and guaranteed ordering.

那么有没有办法在单个工作流程中实现这一目标?最好内置在 WF 中(例如 WaitUntil 活动) - 但另一种可能是工作流休眠,直到收到外部产品.

So is there a way to achieve this in a single workflow? Preferably built in to WF (e.g. a WaitUntil activity) - but an alternative might be that the workflow sleeps until recieving an external prod.

推荐答案

计算持续时间的 Delay 活动就可以做到这一点.

A Delay activity where you calculate the duration will do that just fine.

这篇关于Windows Workflow Foundation - 安排活动在特定时间运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆