I’ve recently learned that it’s possible and even fairly easy to create a state machine workflow using SharePoint Designer. Necessity is the mother of invention and all that good stuff and I had a need this week that looked for an invention. Coincidentally, I came across this MSDN forum post sowel. My personal experience this week and that "independent confirmation" lends strength to my conviction. I plan to write about this at greater length with a full blown example, but here’s the gist of it:
- The approach leverages the fact that a workflow can change a list item, thereby triggering a new workflow. I’ve normally considered this to be a nuisance and even blogged about using semaphores to handle it.
- SharePoint allows multiple independent workflows to be active against a specific list item.
To configure it:
- Design your state machine (i.e., the states and how states transition from one to the next).
- Implement each state as separate workflow.
- Configure each of these state workflows to execute in response to any change in the list item.
Each state workflow follows this rough pattern:
- Upon initialization, determine whether it should really run by inspecting state information in the "current item". Abort if not.
- Do the work.
- Update the "current item" with new state information. This triggers an update to the current item and fires off all the state workflows.
Aside from the obvious benefit that one can create a declarative state machine workflow, all that state information is terrific for building KPIs and interesting views.
It does have a fairly substantial drawback — standaard werkvloei geskiedenis dop is selfs meer nutteloos as normaal 🙂 Dit is maklik reggestel, egter. Store all of your audit type information in a custom list. That’s probably a good idea even for vanilla sequential workflow, maar dit is vir 'n ander blogpos 🙂
I call this a "mea culpa" because I have, ongelukkig, said more than once on forums and elsewhere that one must use visual studio to create a state machine workflow. That simply isn’t true.
</einde>