Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top