Windows Workflow Foundation 4(WF4)延迟 [英] Windows Workflow Foundation 4 (WF4) Delay

查看:89
本文介绍了Windows Workflow Foundation 4(WF4)延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Wf4处理Visual Studio 2010的发布候选版本,以编写新的工作流程来批准资源请求。在我的工作流程中,如果请求没有得到批准,我希望请求在几天后过期。我们在WF 3.5(Visual Studio 2008)中通过在与等待批准者批准请求的EventDrivenActivity并行的EventDrivenActivity中添加Delay计时器来做到这一点。如果延迟在批准之前到期,则EventDrivenActivity将终止请求。有人知道在WF4中是否有类似的机制吗?

I'm working with the the Release Candidate of Visual Studio 2010 using Wf4 to write a new workflow for approving resource requests. In my workflow, I would like for a request to expire after a few days if no approval has been made for the request. We did this in WF 3.5 (Visual Studio 2008) by adding a Delay timer into an EventDrivenActivity parallel to the EventDrivenActivity that was awaiting an approver to come and approve the request. If the Delay expired before an approval was made, the EventDrivenActivity would terminate the request. Does anyone know if there is a similar mechanism for doing this in WF4?

推荐答案

在WF4中,使用以下相同的方法选择活动。一个Pick有多个 PickBranch 子级,每个子级都有一个触发和一个动作。每个触发器都将执行,并且将包含延迟,接收或您正在等待的任何其他内容。该Action包含需要执行的所有内容。仅执行与第一个要完成的触发器相关联的动作,其他触发器将被取消,其他动作将被跳过。

In WF4 this is done in the same way using a Pick activity. A Pick has multiple PickBranch children, each with a Trigger and an Action. The Trigger for each is executed and will contain the Delay, Receive or whatever else you are waiting for. The Action than contains whatever needs to be executed. Only the Action associated with the first Trigger to complete is executed, the other triggers will be canceled and the other actions skipped.

这篇关于Windows Workflow Foundation 4(WF4)延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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