Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Workflow Foundation example - moderation

As part of my Personal Improvement Program (PIP™), I'm trying to learn the basics of Windows Workflow Foundation.

I decided to write a fairly simple blogging engine. I know there are tonnes out there, but this is just a playground project I can use for learning some cool stuff. One of the main features I wanted to implement is the moderation of blog entries using WF. The rest of the project is going to be an ASP.NET MVC app, possibly sprinkled with a little WCF.

From what I've read about WF, I should be using a sequential workflow that should look something like this:

  1. Author adds/ edits blog entry.
  2. Entry gets sent to moderator for approval.
  3. Moderator approves post -- or -- back to item 1. for author to correct, along with moderator notes.
  4. Finish

Every step should also e-mail the receiptiant of the action.

Because of the human interaction factor, I'm guessing the WF runtime would need to serialise itself somewhere so it doesn't loose state (as each activity could be interrupted by AppPool resets, server crashes etc).

Does anyone know of any good examples or places that implement a similar workflow?

Thanks all.

like image 275
Kieron Avatar asked Jul 16 '26 00:07

Kieron


2 Answers

I would hold off on delving into WW for the time being. .NET 4.0 is going to introduce changes to the model of WW to address current pain points. These changes will introduce a model that is fundamentally different from WW today, and learning the current methodologies for WW will not be as helpful if you don't already have a WW solution in place.

More information can be found here:

http://blogs.msdn.com/endpoint/archive/2009/01/20/the-road-to-wf-4-0-part-1.aspx

like image 57
casperOne Avatar answered Jul 18 '26 15:07

casperOne


You're on the right track. Windows Workflow provides a persistence model that allows you to save the state of a running workflow instance to a SQL Server. When a running instance is paused (usually while waiting for input from outside the workflow) the state is automatically serialized to the database.

Here is a starter kit from Microsoft for web-based approval workflows.

like image 30
Dave Swersky Avatar answered Jul 18 '26 13:07

Dave Swersky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!