Freigeben über


What is Workflow, and why bother?

Workflow, of course, is one of those deeply overloaded terms that hinders communication as often as it helps, so I’d better say what I mean by it.

Workflow comes down to just two ideas: that there is work to do, which a workflow sees as opaque units of behavior; and flow, which describes what work gets done when.

So is this a Workflow?

public void HandleLoanRequest (string customerID, Application app)
{
    if (CheckCredit(customerId, app.Amount))
    {
        MakeOffer (customerId, app);
    }
}

Yes, I believe it is.  The work is checking the customer’s credit and making an offer – and HandleLoanRequest defines if and when this work is performed.

But the fact that workflow vendors have traditionally felt that something more than this sort of code is required before they declare victory suggests that we’re still missing a key notion.

This, I believe, is that we don’t just need to describe the flow, but describe it in a way that we can inspect, reason over, and manipulate.  In short, workflow needs a model.

C# is one way to do this - we can define coding standards that allow us to scan workflow code and draw a graph of the flow, for instance.  Or we could define attributes for the developer to use to call out the parts of his code that form the model.  This is not the choice that we made for the Windows Workflow Foundation – and I’ll talk about why we chose what we did in later posts – but it would work.

But back to why we might need a model.  We’re going to have to put in effort to create it, so why bother?  Where’s the payback? (or the beef, as this Englishman abroad is learning to call it).

Well, I think the payback comes from what the model enables -

Visualization  Useful for the developer, during both development and maintenance, but also for the workflow user who wants to know why they are supposed to be doing what they’ve been asked to do, or the IT Ops guy who wants to know what some misbehaving app is, or should be, up to.

Expressiveness  A workflow model is a Domain Specific Language, specialized to support characteristic problems.  An example is a review process where three positive votes out of five reviews mean that the document is good – and any outstanding reviews can be canceled.  This is a little tedious to code, but the Windows Workflow Foundation includes out-of-the-box constructions that address such problems.

Execution  The runtime can exploit the model to take away the need to solve the same problems over and over again.  In the Windows Workflow Foundation we built in support for the knotty problems of long running workflow such as state management and compensation – controlled by simple, expressive model elements.

Monitoring  The existence of a model makes it possible to produce an event stream with a meaningful semantic without any additional developer effort.  This can then be used to monitor instances of workflows, or aggregates.  Windows Workflow Foundation allows also allows declarative decoration of events with application data pulled from the workflow state - so that you can tell that credit check has started for order 14532.

Transformation  Models beget models.  An example is the transformation of a workflow model into the Message Exchange Pattern required to communicate with it – as Dharma and Don demonstrated so beautifully at the PDC.  Another is customization.  An ISV ships a workflow, which is customized by a VAR, and then again by a customer.  Then the ISV ships a new base version.  The use of a shared, well understood model for the workflow makes the consequent 3-way merges much more tractable.

Composition  If an application is factored into flow and work, then the atomic elements of work, with their well understood interfaces, can be reused by other workflows.  Workflows themselves are valid definitions of work that can also be used by other workflows. 

Customization and transformation together enable ecosystems where definitions of work and flow become shared or traded artifacts.

Manipulation  Often there are requirements to invent or modify workflows on the fly.  If this means changing code, then there are going to be problems with the security folks – even if the users understand how to hack it.  Using a model makes possible dynamic manipulation that is both controllable and comprehensible.  The Windows Workflow Foundation supports the dynamic modification of both workflow types and workflow instances.

So that’s it (or at least, all that seeps into my mind this Saturday afternoon).  That’s why we thought a model was a good idea, and why we think it has great ROI.  But if none of these benefits apply in your scenario, then really, coding is still very cool.

Comments

  • Anonymous
    September 18, 2005
    // TODO: learn it and use it...

    Some links
    Windows Workflow Foundation Site
    Introducing Windows...

  • Anonymous
    September 19, 2005
    Wow - been waiting for this for some time now from MS. Have tried and failed to get to grips with previous MS workflow offerings.

    Really pleased to hear right moves to integrate this with Sharepoint and will wait impatiently for this...

    Will be evaluating this against the architecture of other content managment systems using workflow.

    Keep up the great work.

  • Anonymous
    September 19, 2005
    Good blog, great new foundation, glad to see your blogging at last!

  • Anonymous
    September 20, 2005
    Do you have information about how to UnitTests a workflow? There are any plans to integrate WinWF testing with VSTS?

  • Anonymous
    September 29, 2005
    At my previous job, the word "workflow" was at the center of everything. It got to the point where it deserved to be one of those "banished words". http://www.lssu.edu/banished/current.php

  • Anonymous
    February 04, 2006
    Hi,

    Nice and simple explanation about the Workflow. I have been exploring WWF for quite sometime. Could you please explain me where does WWF runtime sits at runtime and how does the WWF model built in the Design time relate to the actual application at runtime. They say that WWF does not have Process of its own, WWF runs inside the Host Application's process space. I am very much confused with all this. Could you please explain me in details.

    Thanks,
    Venky

  • Anonymous
    April 21, 2006
    I think it is also important to discuss when workflow might be overkill a bit too much of a good thing as Venky pointed out.  You can check out this article i came across at <a href="http://workflow.wordpress.com/page/2/">http://workflow.wordpress.com/page/2/</a>

  • Anonymous
    June 07, 2006
    Thanks!!! http://www.insurance-top.com/company/">http://www.insurance-top.com/company/ car site insurance. [URL=http://www.insurance-top.com]home insurance[/URL]: auto insurance, insurance car, Best Insurance Web site. Also [url=http://www.insurance-top.com]cars insurance[/url] from website .

  • Anonymous
    June 07, 2006
    ringtones free

  • Anonymous
    June 20, 2006
    Persone los pioneros non rabata. Great...

  • Anonymous
    June 24, 2006
    Best of all people w can talk...

  • Anonymous
    July 13, 2006
    ringtones free

  • Anonymous
    July 30, 2006
    Well done!
    [url=http://jettxrhj.com/swvm/hztn.html]My homepage[/url] | [url=http://ljuvzcxp.com/sboh/ygih.html]Cool site[/url]

  • Anonymous
    July 30, 2006
    Great work!
    <a href="http://jettxrhj.com/swvm/hztn.html">My homepage</a> | <a href="http://uhwblplj.com/zvhe/jpfd.html">Please visit</a>

  • Anonymous
    July 30, 2006
    Nice site!
    http://jettxrhj.com/swvm/hztn.html | http://jaqijslk.com/ejrr/otzn.html

  • Anonymous
    August 07, 2006
    PingBack from http://www.likeyourwork.com/likeyourwork/?p=146

  • Anonymous
    August 13, 2006
    WF resources

  • Anonymous
    August 15, 2006
    ringtones free

  • Anonymous
    August 19, 2006
    Great title!  Thanks for the overview.

  • Anonymous
    August 22, 2006
    This site is very interesting. Good job =)
    <a href="http://tanklesswaterheater.storage9.com">Tankless water heater</a>
    <a href="http://tanklesswaterheater.bht0a.info">Tankless water heater</a>

  • Anonymous
    August 30, 2006
    hi
    <A HREF=http://d0gma.info/antivirus/map.html>antivirus software</A> <A HREF=http://d0gma.info/antivirus/>antivirus</A>good luck

  • Anonymous
    September 05, 2006
    Hello, good site and interesting design!
    <a href=" http://xanaxsale.tdfsf.info/xanax-sales.html ">xanax sales</a>
    <a href=" http://xanaxsale.tdfsf.info/xanax-sales.html ">xanax sales</a>

    Thanks!

  • Anonymous
    September 25, 2006
    I am so [url=http://access.2surf.eu]lucky[/url] on having what I have! And good luck in yours [url=http://2access.2surf.eu]search[/url].
    Just visit [url=http://access.122mb.com]my site[/url].









  • Anonymous
    October 01, 2006
    The comment has been removed

  • Anonymous
    July 03, 2007
    Nice article!But I was wondering what are the differences between WF and other Workflow technologies?

  • Anonymous
    September 19, 2007
    PingBack from http://blog.lulutech.com/PermaLink,guid,c111cf5a-e034-4b01-80cd-77d6520aa181.aspx

  • Anonymous
    October 29, 2007
    Is there any performance degradation with WWF over normal C# code. If so how much so? Would WWF be ideal for online system scenarios as well as offline?

  • Anonymous
    November 13, 2007
    Excellent write up, good work.

  • Anonymous
    December 29, 2007
    PingBack from http://cars.oneadayvitamin.info/?p=778

  • Anonymous
    January 19, 2008
    Nice and interesting article. Thanks for your great work.

  • Anonymous
    February 16, 2008
    I found this information really helpful.Good work.

  • Anonymous
    February 24, 2008
    Verry good blog. Thanks for all the information.

  • Anonymous
    March 01, 2008
    Good blog, great new foundation, glad to see your blogging at last!

  • Anonymous
    March 01, 2008
    Nice and interesting article. Thanks for your great work.

  • Anonymous
    March 09, 2008
    Hello Dave,all Your blogs are great. Thank You for so much work for us.

  • Anonymous
    April 01, 2008
    The comment has been removed

  • Anonymous
    April 04, 2008
    Thank you for your interesting blog.

  • Anonymous
    May 06, 2008
    Nice and interesting article. Thanks for your great work.

  • Anonymous
    May 06, 2008
    This site is very interesting.

  • Anonymous
    June 17, 2008
    Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje Klimatyzacje

  • Anonymous
    August 02, 2008
    Verry good blog. Thanks for all the information.

  • Anonymous
    September 03, 2008
    Very great and excellent article. It’s realy helpful. Thanks again.

  • Anonymous
    September 10, 2008
    Can you please clean up several SPAM messages in blog? SPAMS really irritate while reading blog.

  • Anonymous
    November 19, 2008
    Hi, This is really a nice article . I can understand the uses and advantages of the workflow easily . Thanks

  • Anonymous
    January 01, 2009
    Good blog, sorry to see it is not active

  • Anonymous
    February 25, 2009
    Wow - been waiting for this for some time now from MS. Have tried and failed to get to grips with previous MS workflow offerings.

  • Anonymous
    June 02, 2009
    PingBack from http://uniformstores.info/story.php?id=45165

  • Anonymous
    June 08, 2009
    PingBack from http://quickdietsite.info/story.php?id=538

  • Anonymous
    June 16, 2009
    PingBack from http://workfromhomecareer.info/story.php?id=13973

  • Anonymous
    June 16, 2009
    PingBack from http://fixmycrediteasily.info/story.php?id=1666

  • Anonymous
    June 17, 2009
    PingBack from http://pooltoysite.info/story.php?id=2255

  • Anonymous
    June 18, 2009
    PingBack from http://outdoordecoration.info/story.php?id=892

  • Anonymous
    June 18, 2009
    PingBack from http://gardendecordesign.info/story.php?id=3942

  • Anonymous
    October 24, 2009
    Very great article! Thanks for sharing! I'm looking forward for new postings!!

  • Anonymous
    December 13, 2009
    Thanks for pointing out the advantages. some addisional info .... http://blog.bitlinkit.com/post/WorkFlow.aspx

  • Anonymous
    October 26, 2012
    This is really a nice article . I can understand the uses and advantages of the workflow easily . Thanks www.ischiahotelgrilli.com

  • Anonymous
    October 26, 2012
    Hello Dave, all Your blogs are great. Thank You for so much work for us. http://www.ischiamobile.com

  • Anonymous
    November 23, 2012
    great article. I like workflow! www.kfz-unfall-schaden.de

  • Anonymous
    December 04, 2012
    Thank you for your interesting blog. www.mybest24.com