Windows 工作流程和全球事件

发布于 2024-09-24 10:45:19 字数 320 浏览 9 评论 0原文

我对使用 Windows 工作流相对较新,但我们有一个要求,即所有当前活动的工作流都根据“​​全局事件”而不是基于单个实例的事件执行操作。

例如,您可以有一个用于提交和跟踪票证的工作流程,在这种情况下,当支持台回家时,所有活动工作流程都会向提交票证的人生成一封电子邮件,说明他们的票证不会被取消。今天不看。

做到这一点的最佳方法是什么?

它是自定义活动还是枚举所有活动工作流程并触发事件/将项目排队到工作流程队列的某种其他方法?

显然,从工作流程的角度来看,最好在其中包含一个在办公室关闭时触发的活动(在上面的示例中)。

我们非常感谢所有的意见。

I'm relatively new to using Windows Workflow but we have a requirement whereby all currently active workflows undertake an action based upon a "global event" rather than an event based upon a single instance.

e.g. you could have a workflow which is used for the submission and tracking of tickets, with the scenario that when the support desk goes home all of the active workflows generate an e-mail to the person who submitted the ticket saying that their ticket won't be looked at today.

What is the best approach to do this?

Is it a custom activity or some other method of enumerating all of the active workflows and firing an event/queueing an item to the workflow queue?

Clearly from the workflow perspective it would be nice to have an activity within it which is fired when, in the case of the example above the office closes.

All input gratefully received.

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

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

发布评论

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

评论(2

他不在意 2024-10-01 10:45:19

这取决于您托管工作流程的方式。使用工作流服务和 WCF 消息传递是迄今为止更简单的选择,也是我的首选。

假设您使用启用了持久性的工作流服务,您可以轻松地从存储中获取每个工作流实例的列表,以便您可以向它们发送 WCF 消息。使用实例存储中的活动书签,您实际上可以查看工作流是否支持当前有问题的操作。

如果您使用事情更难的广告进行自我托管,您将需要创建一个带有书签的自定义活动来处理此问题。但假设工作流程可以从内存中卸载,您将需要一些外部代码来重新加载工作流程。

BTW 工作流队列是 WF3 的一项功能,已被 WF4 中的书签取代。

It depends on how you are hosting your workflows. Using workflow services and WCF messaging is by far the easier option and would be my preference.

Assuming you are using workflow services with persistence enabled you can easily get a list of each workflow instance from the store so you can send the WCF message to them. Using the active bookmarks in the instance store you can actually see if the workflow supports the operation in question at the moment.

If you are self hosting using things are a lot harder ad you will need to create a custom activity with a bookmark to handle this. But assuming workflows can be unloaded from memory you will need some external code to reload the workflows.

BTW workflow queues are a WF3 feature that has been replaced by bookmarks in WF4.

初熏 2024-10-01 10:45:19

执行此操作的一种方法是让托管工作流运行时的应用程序将工作项排队到工作流队列中。所有需要响应此刺激的活动都必须有此队列的书签。

One way to do this would be to get the application hosting the Workflow Runtime to enqueue a work item into the workflow queue. All activities that need to respond to this stimulous must have bookmark for this queue.

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