如何安排 Windows 工作流的执行?
我想将计划任务移至工作流程中,以便我可以更好地监控它们的执行情况。目前,我正在使用 Window 的计划任务来调用启动该进程的 Web 服务。是否有一个工具可以用来安排序列的执行,以便它每 N 分钟发生一次?
我的最佳解决方案是:
- 易于配置
- 提供有关错误的有用反馈
- “一劳永逸”
PS - 尝试用于 Windows Server 的 AppFabric(如果添加任何选项)。
I'd like to move my scheduled tasks into workflows so I can better monitor their execution. Currently I'm using a Window's scheduled task to call a web service that starts the process. Is there a facility that you use to schedule execution of a sequence so that it occurs every N minutes?
My optimal solution would:
- Easy to configure
- Provide useful feedback on errors
- Be 'fire and forget'
PS - Trying out AppFabric for Windows Server if that adds any options.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我所知道的最直接的方法是为每个工作流程(可以是控制台或 Windows 应用程序)制作一个可执行文件,并让它通过代码托管工作流程。
这样你就可以继续使用计划任务来管理任务,主要问题是反馈/监控流程。为此,您可以输出到控制台,写入事件日志,甚至使用 Windows 应用程序进行更高级的可视化 - 尽管您必须自己编写(或谷歌搜索!)。 此 MS 工作流监控示例可能感兴趣,但尚未使用我自己。
类似的错误处理,尽管在这种情况下写入事件日志是正常的操作过程。
除了 Dynamics CRM 等之外,我不知道还有任何其他 WF 主机,但这不会帮助您完成您想要做的事情。
The most straightforward way I know of would be to make an executable for each workflow (could be console or windows app), and have it host the workflow through code.
This way you can continue to use scheduled tasks to manage the tasks, the main issue is feedback/monitoring the process. For this you could output to console, write to the event log, or even have a more advanced visualisation with a windows app - although you'd have to write this yourself (or google for something!). This MS Workflow Monitoring sample might be of interest, haven't used it myself.
Similar deal with errors, although writing to the event log would be the normal course of action in this case.
I'm not aware of any other hosts for WF, aside from things like Dynamics CRM, but that won't help you with what you're trying to do.
您需要使用调度程序。要么自己动手,使用提到的 AppFabic 要么使用 Quartz.NET:
http://quartznet.sourceforge.net/
如果你使用 Quartz,它要么推出你自己的服务主机,要么使用现成的,并使用xml进行配置。我自己做了一个,效果很好。
You need to use a scheduler. Either roll your own, use AppFabic as mentioned or use Quartz.NET:
http://quartznet.sourceforge.net/
If you use Quartz, it's either roll your own service host or use the ready-made one and configure it using xml. I rolled my own and it worked fine.
Autorun 是另一个免费选项... http://autorun.codeplex.com/
Autorun is another free option... http://autorun.codeplex.com/