Search code examples
wcfworkflow-foundation-4

WF4 + WCF services...what's the accepted approach from people who USE this?


I'm about to dive into WF4 and I have been reading blog after article on "what to do"...but almost without exception either a) the "demo" is so simple to be useless, b) the demo doesn't compile/work/run or c) it meets a need based on "showing what I can do, not what a business needs".

So:
To any SOers out there that actually USE WF4 - what approach would you take for a workflow like this?

  • "Customer" submits a request.
  • "User" opens it, completes some fields and saves.
  • If over a certain "value" for for approval stage
    • Else goes to next stage automatically
  • Email gets sent sent to originator and next department is picked based on "some logic"
    • If next department do nothing for x days then another email sent, copying their manager.
  • Next department "get" the request to work on.
  • ...etc etc in similar vein

IMHO: This is pretty standard business processing with some automation, but mostly human interaction - SharePoint does this kind of thing apallingly and fails to meet almost all of our requirements, so we're looking to build it ourselves.

Should I build a WCF-WF service? Then add MCV3 for human interaction?

Should I build traditional WCF services + MVC3 that handle user interaction, and "call" (i.e. sit on top of...but NOT using the "WCF WF") WF4?

Ignore WF4 all together and just use WCF + MVC3 or similar?

Thanks for any real-world advice and especially any realistic blogs/articles!


Solution

  • As WF4 is mainly used to solve complex business problems it is almost impossible to use real works examples in a blog post/article.

    Your example sounds like the thing i would model in a workflow. I would use a workflow service if the workflow is pretty much a fixed thing or else a WorkflowApplication if you want to be more flexible and have users/organizations modify workflows.

    I have use the workflow state in the instance store to drive the UI very successfully. Basically having list of workflows based on the bookmarks it is waiting for to be resumed and enabling disabling UI controls based on the same information.

    Keep in mind that WF4 has quite a learning curve. It certainly isn't rocket science but if you are new you can fall into traps and do the wrong thing.I would recommend Pro WF: Windows Workflow in .NET 4 or (shameless self plug) Essential Windows Workflow Foundation 4 (WF4) Training.