makerofthings7
makerofthings7

Reputation: 61433

Using Workflow Foundation in MVC3 to handle Page Flow (as in a Wizard)

I want to decouple the MVC web pages, and the order in which they are displayed. Generally speaking, I think these are the scenarios I need to address, but I'm lot locked into a particular way of thinking. I just want to find a pattern or an object that will assist in controlling the flow.

Sample Page Sequencing:

For those times when a user may enter into more than one "valid state", the forward concept above should accomodate that (such as in a State Machine)

Question:

How would I implement this page control flow in a MVC3 / WF4 application?

enter image description here

Upvotes: 4

Views: 4338

Answers (2)

Raist
Raist

Reputation: 41

We're ourselves considering an architecture similar to your proposal. The MVC part is mainly auto-generated code with Llblgen Pro + custom ASP.Net templates, therefore, we want to control the business logic (and page workflow) from somewhere else.

We're still studing the final decision, and WF 4.0 is one candidate (as it's quite easy to create a reusable activities' library), but Stateless state-machine seems an really simpler approach and easier to maintain. We already have an ORM-generated persistence layer, therefore, it's not a big deal to resume the state of a paused workflow any time in the future. Have a look at Stateless and let us know if it fits.

An example explained: http://blogs.msdn.com/b/nblumhardt/archive/2009/04/16/state-machines-in-domain-models.aspx

Actualized VS 2010 code with examples: https://github.com/haf/Stateless

Upvotes: 4

Jeremy Bell
Jeremy Bell

Reputation: 2174

I explored this idea. In my opinion, Workflow Foundation would only be worth it if your process takes a long time (like days).

Otherwise, you'll find that writing some kind of custom code (like a State Machine) is a much easier solution than trying to incorporate Workflow Foundation.

However, if you're looking for examples, here's one: http://code.msdn.microsoft.com/Windows-Workflow-233b5e3c/sourcecode?fileId=22211&pathId=1790082120

Upvotes: 3

Related Questions