What are the best methods for hosting MS Windows Workflow for an asp.net mvc application?

I am working on an asp.net mvc project that will use the MS Windows Workflow Foundation to manage client business workflows. These are long workflows that span a time of a year or two. Therefore, we decided to use State Machine workflows. A workflow instance will be stored in the database if it is not in use (or in standby mode).

I am new to MS WF and would like to know the best practices for implementing workflows for an asp.net mvc application.

In particular, where should I host the WF runtime? In asp.net mvc or in a separate process like a windows service?

I would really appreciate it if I heard success stories about how MS WF is implemented in asp.net mvc?

Any comments and ideas are welcome.

Thanks everyone

Cullen

+4
source share
1 answer

You mean WF3 or WF4, which is a completely different piece of code.

With WF3, a central WorkflowRuntime exists and is usually hosted somewhere in the application or possibly at the session level.

Update Some of the things you need to pay attention to:

  • IIS can recycle AppDomain anytime it wants, when incoming calls are not processed. An asynchronous workflow is NOT considered part of the request because it is running in a different thread.
  • To migrate workflows from the old to the new AppDomain, you need a save service.
  • The new AppDomain cannot be activated immediately, causing the delay actions to not execute as soon as you expected.
  • It is generally best to use a manual workflow scheduler, but this makes the writing code a little more complicated, since you need to schedule work and then start execution.
+3
source

All Articles