Workflow Systems: Myths, Truths and Wishful Thinking

Post on 05-Dec-2014

2.327 views 5 download

Tags:

description

IASA Denver Talk on Workflow Systems, September 2009

Transcript of Workflow Systems: Myths, Truths and Wishful Thinking

Workflow Systems

Brandon SatromChief Architect, Thought Ascentbrandon.satrom@thoughtascent.comwww.userinexperience.com

Myths, Truths and Wishful Thinking

Copyright 2009, Thought Ascent, Inc

Opinionated Architect. Often wrong.

Continually improving.

About Me - In Six Words

Long-time Microsoft developerFormer Enterprise Architect

Alt.Net guy, but still nicePresident, IASA Austin

Copyright 2009, Thought Ascent, Inc

Worth mentioning?

Experience with vendor WF toolsExperience with BizTalk (2002+)

Recently built a successful production implementation using WF 3.5See that “opinionated architect” comment.

Copyright 2009, Thought Ascent, Inc

What qualifies me to talk about Workflow…

Copyright 2009, Thought Ascent, Inc

So what is “Workflow” anyway?

Copyright 2009, Thought Ascent, Inc

A workflow is a depiction of a sequence of operations, declared as work of a person, a group of persons, an organization of staff, or one or more simple or complex mechanisms. Workflow may be seen as any abstraction of real work, segregated in workshare, work split or other types of ordering. For control purposes, workflow may be a view on real work under a chosen aspect, thus serving as a virtual representation of actual work. The flow being described often refers to a document that is being transferred from one step to another.

– from http://en.wikipedia.org/wiki/Workflow

Copyright 2009, Thought Ascent, Inc

How about something simpler?

The coordination of work in a “system”

Copyright 2009, Thought Ascent, Inc

Copyright 2009, Thought Ascent, Inc

Got it. So then what’s a “Workflow System?”

Perhaps…

An application that assists in the definition and/or execution and/or management of workflows

Copyright 2009, Thought Ascent, Inc

Copyright 2009, Thought Ascent, Inc

That sounds too similar to a “normal”

system. What’s the difference?

How a workflow system differs from a traditional program

In theory, at least…

Copyright 2009, Thought Ascent, Inc

Declarative

Copyright 2009, Thought Ascent, Inc

Activity A Activity B

Persistent

Copyright 2009, Thought Ascent, Inc

Activity A Activity B Activity C (Idle)

Activity D (Active)

Persistence Store

External Stimulus

Dynamic

Copyright 2009, Thought Ascent, Inc

Activity A

Activity B

Activity C

Activity D

Activity E

Activity F

Business Change

Divert to new activity

Configurable

Copyright 2009, Thought Ascent, Inc

Activity A Activity B Activity C

Rules Store

Activity D

Activity E

Centrally Defined…

Copyright 2009, Thought Ascent, Inc

… though not necessarily visual.

Copyright 2009, Thought Ascent, Inc

static SessionSaga(){ Define(() => { Initially( When(NewSession) .Then((saga, message) => saga.NewSessionStarted(message)) .TransitionTo(SessionActive) );

During(SessionActive, When(FeedbackCheckRequested) .Then((saga, message) => saga.CheckForFeedback(message)) When(new Timer() .StartOn(session.Start)

.RunAtInterval(session.CheckInterval) .Until(session.End))

.Then((saga, message) => saga.CheckForFeedback(message)) When(SessionComplete) .Then((saga, message) => saga.SessionEnded(message)) .Complete() ); });}

Copyright 2009, Thought Ascent, Inc

Ok, I get it. So why are we

still doing this presentation?

Copyright 2009, Thought Ascent, Inc

Workflow has a PR problem…

Copyright 2009, Thought Ascent, Inc

There seem to be two sides…

Copyright 2009, Thought Ascent, Inc

…who can’t (or won’t) get along.

The “Workflow will Save us all” side

Copyright 2009, Thought Ascent, Inc

The “Run like you’re on fire” side

Copyright 2009, Thought Ascent, Inc

Copyright 2009, Thought Ascent, Inc

I’d like a third option

please.

Copyright 2009, Thought Ascent, Inc

How about the best of both?

Consider both sides of the story…

And be a cautious optimist…

Copyright 2009, Thought Ascent, Inc

There are reasons to get excited about Workflow…

Copyright 2009, Thought Ascent, Inc

Copyright 2009, Thought Ascent, Inc

Visual, Visual, Visual

Copyright 2009, Thought Ascent, Inc

Clear expression of intent from domain experts…

Copyright 2009, Thought Ascent, Inc

The Next “Great Leap” in software

…and there are reasons to be wary…

Copyright 2009, Thought Ascent, Inc

Steep-learning cu

rves

Copyright 2009, Thought Ascent, Inc

Copyright 2009, Thought Ascent, Inc

Poor Performance

Copyright 2009, Thought Ascent, Inc

Sleights of hand and shell-games

Copyright 2009, Thought Ascent, Inc

Both sides are right …

Both sides are wrong….

Copyright 2009, Thought Ascent, Inc

Right and wrong? How

so?

Myths, Truths and Wishful Thinking

Copyright 2009, Thought Ascent, Inc

1) Visual Workflow Tools are the only way to “do” Workflow

Copyright 2009, Thought Ascent, Inc

Myth

Copyright 2009, Thought Ascent, Inc

Is this really easier to comprehend…

Copyright 2009, Thought Ascent, Inc

Than this?

require 'rubygems' require 'statemachine'

vending_machine = Statemachine.build do state :waiting do

event :dollar, :paid, :activate event :selection, :waiting on_entry :sales_mode on_exit :operation_mode

end trans :paid, :selection, :waiting, :release trans :paid, :dollar, :paid, :refund context VendingMachineContext.new

end

Copyright 2009, Thought Ascent, Inc

The Truth

Many open-source “code-first” solutions offer most of the benefits of a workflow system without the steep learning curve.

Copyright 2009, Thought Ascent, Inc

Demo –Workflow with Mass Transit

Copyright 2009, Thought Ascent, Inc

2) Workflow should be running all your application logic

Copyright 2009, Thought Ascent, Inc

Lie

Copyright 2009, Thought Ascent, Inc

Turn a simple flow…

Copyright 2009, Thought Ascent, Inc

…into “Spaghetti Flow”

Copyright 2009, Thought Ascent, Inc

The Truth

Workflow systems can be a good choice for managing long-running, complex processes, but don’t yet perform well-enough to handle all your logic.

Copyright 2009, Thought Ascent, Inc

3) Domain experts can (and should) easily change workflows at runtime

Copyright 2009, Thought Ascent, Inc

Copyright 2009, Thought Ascent, Inc

Wishful Thinking…

Copyright 2009, Thought Ascent, Inc

The Truth

We don’t change systems at runtime without some diligence. So why would our users?

That said. There are models that are more illustrative of reality…

Copyright 2009, Thought Ascent, Inc

4) Declarative/Visual App Dev is easier than traditional dev…

Copyright 2009, Thought Ascent, Inc

Half-Truth

Copyright 2009, Thought Ascent, Inc

The Truth

Where it’s easier:OOB programming constructs (IF, While, etc)Encourages/ Rewards SRP-development

Where it’s harder:Visual IDEs slower than code IDEsTesting is hard, if not impossibleRefactoring involves more rework than necessary

Copyright 2009, Thought Ascent, Inc

5) “I can build a WF system in 100 lines of code”

Copyright 2009, Thought Ascent, Inc

Wishful Thinking…

Copyright 2009, Thought Ascent, Inc

The TruthCode-only solutions can address simple scenarios quickly…

But tend to unravel when persistence, durability, scale, timed-events, long-running processes, human workflow and other complex issues are introduced.

Copyright 2009, Thought Ascent, Inc

Demo:

The Faceplant Application“Social Speaking”

Copyright 2009, Thought Ascent, Inc

Copyright 2009, Thought Ascent, Inc

Congratulations! You’ve done an excellent

job of not telling me

what I should do…

Open Discussion – When should a Workflow Tool be considered?

Copyright 2009, Thought Ascent, Inc

When does WF make sense?

Copyright 2009, Thought Ascent, Inc

Copyright 2009, Thought Ascent, Inc

I think it’s time for the bottom

line…

There is no simple answer…

Only the right tool for the job

Copyright 2009, Thought Ascent, Inc

The Right Tool for The Job might be…

“Roll Your Own” WorkflowUse an open-source Bus

NServiceBusMass TransitSimple ServiceBus

Use an open-source State management toolSimple State Machine

Use Windows WFAfter you’ve exhausted all other possibilities

Copyright 2009, Thought Ascent, Inc

Consider a “Workflow System” when:

Need a visual, changeable representationTimed-events are keyLong-running:

TransactionsConversations Services

Many, complex processes Economies of scale principle

Copyright 2009, Thought Ascent, Inc

Don’t start with a workflow system as a solution.

Get there by eliminating other options

Copyright 2009, Thought Ascent, Inc

And pay attention…

Software development is changing.

Copyright 2009, Thought Ascent, Inc

Questions?

brandon.satrom@thoughtascent.comwww.userinexperience.com

Twitter: @thesatch

Code and slides available at: http://github.com/bsatrom/WorkflowSystems

Copyright 2009, Thought Ascent, Inc

Image Credits

WF System, InfoWorldhttp://www.infoworld.com/d/developer-world/product-review-ultimus-jump-starts-bpm-deployment-546?page=0,1

Pinnochio – House of Sims, Flickrhttp://www.flickr.com/photos/houseofsims/2662410465/

Myth – Mythbusters on Discoveryhttp://dsc.discovery.com/fansites/mythbusters/wallpaper/wallpaper.html

Steep Learning Curve – Casual Game Designhttp://www.casualgamedesign.com/?p=27

Skeptic Guy – Flickhttp://www.flickr.com/photos/mcleod/3909431214/in/set-72157607796029636

Copyright 2009, Thought Ascent, Inc