Hosting workflow services with durable timers / delays
-
Thursday, July 29, 2010 2:02 PM
If I host a workflow service in IIS, will persisted workflows with expired timers be reliably and automatically reloaded? What about if I host it with WorkflowServiceHost in my own app?
I haven't been able to find a clear answer to this question - all I found were old posts referring to the betas, where apparently you needed Workflow Management Service to do this, but this isn't in the shipping version of Workflow Foundation. I'd greatly appreciate a clear unambiguous answer.
Answers
-
Friday, July 30, 2010 4:44 PM
Because AppFabric gives you WorkflowManagementService and ServiceManagementService.
If you do not want to use AppFabric, you will need to write both of these yourself.
- Marked As Answer by Zhen Lin Monday, August 02, 2010 9:46 AM
All Replies
-
Thursday, July 29, 2010 2:14 PM
Hi,
If you are hosting in AppFabric workfoes will persist after a specified time, and store their state in the persistance database. When a timer expires the workflow will be loaded into mamory and continue execution.
If you are hosting in IIS (without AppFabric) the workflows will remain in memory, and will not persist (there is no persistence store). When a timer epxperies, the workflow will continue executing, but if the IIS process restartts, you will lose the state of the workflow.
If you host in your own app you can, if you want to, build your own perssitance service. You will have to ensure that the persistance service handles timer expirations and reloads workflows.
Regards,
Alan
www.CloudCasts.net - Community Webcasts Powered by Azure -
Thursday, July 29, 2010 3:09 PMThe built-in SqlWorkflowInstanceStore supports monitoring for runnable instances, but I gather that some support from the workflow host is required for it work properly. I understand that, for example, WorkflowApplication will not automatically reload instances even if I use the SqlWorkflowInstanceStore. My question is, if I use the SqlWorkflowInstanceStore in conjunction with WorkflowServiceHost, in IIS, will I get reliable behaviour?
-
Thursday, July 29, 2010 10:06 PMAs Alan mentioned, if you use AppFabric then you will get reliable behavior with IIS, WorkflowServiceHost and SqlWorkflowInstanceStore.
-
Friday, July 30, 2010 8:16 AM
But my point is that I can use SqlWorkflowInstanceStore and WorkflowServiceHost without AppFabric. How does AppFabric bring reliability?
Is there any way at all to do this without AppFabric? At the moment I'm developing for Windows Server 2003, and I don't know if targeting only Server 2008 is an option.
-
Friday, July 30, 2010 4:44 PM
Because AppFabric gives you WorkflowManagementService and ServiceManagementService.
If you do not want to use AppFabric, you will need to write both of these yourself.
- Marked As Answer by Zhen Lin Monday, August 02, 2010 9:46 AM
-
Tuesday, September 14, 2010 11:42 AM
Zhen,
Did you get any further with this?
I can use AppFabric but maybe I dont want to so I need a workflow to re-hydrate its self when I timer expires using the WorkflowServiceHost.
So confused. I have been googling for days and there is no decent info out there!!
thanks
RuSs
xxxxxx -
Tuesday, September 14, 2010 3:06 PMWhat further information do you need?
-
Tuesday, September 14, 2010 3:20 PM
Hi Stuart,
I have been slogging away for ages here and have got the gist of WF 4.0.
I have a workflow of type WCF Workflow Service Application.
It all runs ok and I have persistence to a SQL db working.
I even have it working so it will de-hydrate and re-hydrate on a bookmark event.
I have it self hosting and I consume it from a windows forms app and a web app.
It is an expense approval application.
My forms app. loads it up as follows:
proxy = new TTExpenseApproval.WindowsClient.SubmitApp.ExpenseServiceClient();
proxy.BeginSubmitExpense(CreateExpenseRequest(), OnStartCompleted, null);
(I have a service ref. in my windows forms app. and web app. that point to my WF Service)
Both clients run the workflow correctly.
I have now added a delay in the left side of a pick activity.(the right side has my existing resume bookmark point)
So what I want it to do is wait for the bookmark event (the manager got an email asking them to perform an action. They click on a link in an email and load up the web app. and click approve / reject - this actions the bookmark.) but if they are lazy I want a delay activity to kick in after say 2 days. (currently I have it set to 2 mins) and after the delay activates, the workflow should rehydrate and to the bit of the workflow after the delay activity (i.e send a reminder email).
the workflow, however never re-hydrates from the persistence store.
I have a feeling I should be using the WorkflowServicehost or appFabric (currently getting a server set up with appFabric on it).
I thought that if a workflow was self hosting as a service, then the workflowServiceHost was actually running it?
anyway, my main reason for writing this is.
i want to write a Workflow that does what I mentioned above.. ie bookmarks, persistence and delays.I want it to be consumable by web, windows or any other .net client.
I just need some advice on the best way to go forward.
Really would love some guidance
thanksRuSsrussell.mccloy@googlemail.com
- Edited by royce2009 Tuesday, September 14, 2010 3:21 PM weird xxxx at end of message
-
Tuesday, September 14, 2010 3:36 PM
When you say you have it self hosting, are you using WorkflowServiceHost or WorkflowApplication to host? Self hosting with WorkflowServiceHost should result in the instances being reloaded when the delay is complete, provided your host is running.
From the scenario you describe I think you best avenue is to use IIS + AppFabric to host your workflow. You get HA, Monitoring, query and control "out of the box" and can concentrate on your workflow logic rather than the infrastucture to host it.
-
Thursday, October 21, 2010 11:14 AM
I am confused regarding the resuming/hydration of persisted workflows.
How is it possible that IIS7 cannot handle the resuming of persisted workflows out of the box, while it works perfectly using the VS2010 DevWebServer when developing? Does the Dev Server have a builtin AppFabric or what? It doesn't make sence to me...
Regards
Anders

