The concept of workflows comes from the time when work was
rather mechanical. People (and later machines) were supposed to
repeat precisely defined steps in a fixed order (or sequence). Any
deviation from prescribed path, any thinking and improvising was
not welcome. Assembly lines or microprocessors - they were all
realizing rigid sequences.
In today's business world processes are present everywhere. They
are also driven by humans. This means that process automation is
not sufficient anymore. It's reducing people taking part in the
process to a simple machine-like element. We can, however, support
people in the process by using state machine workflows.
State machine and sequential workflows
Before explaining advantages of state machine workflows over
sequential ones, let's try to understand the difference between
them. Let us take a look at an example, one that is probably known
to all (or most) of us: an in-car GPS navigation. When you set your
destination, the GPS shows you the way with detailed instructions
where to turn, where to go straight ahead. There is only one
itinerary (may have variations if there is traffic jam) and one
sequence of moves. You follow them by mechanically performing
instructions (turns) defined by your navigation system. You don't
think, don't make decisions. It's like sequential process. Now -
imagine a map with a starting point and your target. You want to
reach your final destination, but on your way you make some
decisions that may change the way. You may decide to visit another
city, take scenic route instead of highway, stop for lunch or go
back to the city you already visited. Of course, choices are
limited in order to let you finally come to the end point, but you
decide how to compose your itinerary. It's similar to a state
machine workflow: it moves from state to state when an external
event (in this case your decision) moves it to the next state. You
can control at least some aspects of the process.
Coming back to our business processes, imagine a Contract
Approval that has to have three approvals: Legal Department,
Finance Department and your boss. Let's assume that you may get
them in any order. In sequential process the order of approval is
predesigned, for instance: first Legal Department, then Finances,
and finally your boss. You can't change it - you have to follow it.
In the state machine process, however, it's the user who decides to
which department he wants to send it first (assuming that you want
to leave this option to the user). The only requirement is that at
the end he has to have all three approvals.
State machine model clearly separates states in which the
process awaits a specific action to be performed (approval of a
document, its verification, rejection, asking for correction etc.),
and transitions which may be a single action or a sequence of
actions. Usually states are places for human decisions, while
actions are programmed and performed by machine. Sequential model
mixes it all in one schema. Sequential workflows are
predictable and in control of the process. State machine workflows
are controlled by external environment (people, for example) and
may have many paths.
How does it affect business?
Now, understanding the difference, let's move on to the
question: WHAT DIFFERENCE DOES IT MAKE IN BUSINESS? Today
companies need to be agile and their processes need to change,
constantly adapting to rapidly changing conditions. Also, in
most cases there exist a lot of varieties of a single process. When
we look at Expense Approval or Purchase Order, usually we have one
path with many different variations depending on the type of order
or expense. In the sequence world we have to foresee and program
all possible paths. That makes the schema completely unreadable and
the process absolutely unchangeable. A small change in the process
definition requires changing of all the variations. In the state
machine world, however, you have only to draw the main logic of the
process and account for all the possibilities. If the logic changes
slightly you change only the main part. It's the user who decides
which variation to take.
Let's take a look at the first example - Contract Approval -
to better understand the problem. As mentioned before, we have
to receive three approvals (Legal, Finance and Boss).
The sequential process will look like this:

The state machine process will be:

At this point the sequential process is a better choice. It
clearly guides you from start to end. But in many cases user may
have his own preferences about the order in which he gets the
approvals. He might, for example, know that the lawyer is making
many changes and wants him to be first, or knows that boss is going
tomorrow on holidays so wants boss to be first). This situation may
be different in various departments, so you might like to put all
these choices in the process. Now things get complicated. With
state machine process we don't have to change anything -the order
of approvals is not built in the design.
Sequential process has to have all the choices and alternate
paths hardwired, so the final schema will look like below:

Well, now we have all possibilities and the same flexibility as
in the state machine workflow.
But what will happen if we add a fourth Approver (2nd Boss, for
example)? In state machine we add just one state:

In sequential we have to add fourth person in all branches, plus
fourth condition ("if") and new branches. Try to imagine how the
chart will look like.
Advantages of state machine workflows
This gives us first very important advantage of state machine
workflows: flexibility. Both in the way the workflows are
run and in implementing changes.
A quick look at both diagrams instantly shows us also the next
difference: readability. Business processes require
cooperation of many different people from within the company, as
well as from outside (consultants, customers, partners…). Some of
them are technical, some are business users. A common platform
understandable by everyone is the first important thing to enable
cooperation. As mentioned before, businesses today need
constant adaption and constant improvement of processes.
Not having a possibility for everyone to read the process makes
this task very difficult, if not impossible. Business analysts,
users and programmers must speak the same language. In order to do
it with sequential process, you are forced to add a layer
understandable by all. Every change in the process definition
requires change in the business layer as well. State machine
processes are naturally divided into business layer (states and
transitions between them) and technical layer (programmed actions).
There is no need to synchronize them or to check whether they fit -
it's all in the nature of state machine process.
It's also critical for the user to see and understand the whole
process in order to make a decision about next actions. Here
readability is the key to management of the
process. User, enabled to take control of the process can, and has
to, see and understand the whole order, as well as where the
process is at the time and what options does the user have.
Managers may have a broad picture of the current state of the
actions. They can see in which phase all the processes are at any
given time. Then they can analyze them, finding states in which the
processes get stuck. They can optimize them by finding shortest (or
quickest) paths based on current behavior and history.
State machine is the human approach to the workflow
world. When we think about processes, we are usually wondering
about their current status (state of the workflow) and what will
happen next or what should be done next (action). When one draws
the process representation it looks like in this picture:

That's exactly what state machine process diagram looks like.
Why to translate this into a difficult to read and comprehend
sequential workflow:

When we can leave it in the same form it was designed?

To summarize: state machine workflows are the only logical
choice in rapidly changing business environment. They provide great
flexibility needed for constantly changing workflows. They
are clear and relatively simple, which results in
readability sought by all participants from users, through
business analysts, consultants, partners, customers, to programmers
that have to implement the automation of the process. Finally,
state machine workflows enable management and
optimization.
And, most of all, they are human-centric,
representing the way we think of processes and act during their
execution.
In this article I have simplified things in order to better show
and explain the matter. Most (if not all) workflows may be
implemented using either of the process types, but state machine
have clear advantages, unless you want people to follow only the
narrowly defined paths and be controlled by the process - which in
some cases may be desirable.
Paweł Misiurewicz
Datapolis, CEO
Datapolis are already
signed up as Silver Exhibitors for the ESP Conference 2013. Why not
join them? Contact sponsor@sharepointeurope.com
or call +353 91 514501 to learn more about sponsorship &
exhibition opportunities.
Stay tuned for more SharePoint content by joining our community or by
following us on twitter or
facebook.