3
votes

I'm working with Beta 2 of Visual Studio 2010 to get some advanced understanding of WF4. I've created a workflow that has a Pick Activity that is contained in an If Activity. In the Pick Activity I have two Triggers, one that contains a Delay set with a TimeSpan of 10 seconds, the other Trigger has a Bookmark for a manager to approve. I'm trying to use the Delay to set a "state" variable to "Expired" if the manager doesn't approve in the allotted time. This is very similar to what Matt Milner did in his post at: http://msdn.microsoft.com/en-us/library/ee342461.aspx, except he uses a DoWhile Activity, whereas I need to use the If Activity I've described here. I'm also using persistence and hosting the workflow from an ASP.Net application. I'm wondering if the problem I'm seeing is caused by the internet browser not keeping the workflow running in memory, and there is no way for the workflow to come be re-started when the delay completes.

1
What is the problem you're seeing? - Chris Gillum
I have a Pick that contains 2 Triggers, one has a Delay in it with an Action that just has an Assign that sets the value of a string variable named "state" to "Expired". The other Trigger has a bookmark in it, with some code to process an approval if the bookmark is resumed. The bookmark works fine, as long as I resume it before the Delay times out. The problem is that after the delay period has passed, and the state is set to "Expired", I'm thinking that the workflow should complete and be removed from the persistence store, but it doesn't get removed. - Russ Clark
Your workflow is persisting OK when the BookmarkWait and Delay branches go idle, right? - Tim Lovell-Smith

1 Answers

2
votes

If you are using the WorkflowServiceHost, or a XAMLX, to host the workflow you will need to configure the WorkflowManagementService to reload and restart the workflow. If you are using the WorkflowApplication you are responsible for reloading the workflow after it has been persisted.

But as Chris said: a bit more info on what is actually going wrong might be helpful here.