Skip to main content
 
Go Search
Home
Categories
Bloggers
Creating a MOSS State Machine Workflow (Part 1 of 4: Concepts and Planning)
By: Matt Morse | Posted: May 10, 2007 at 11:30 AM

Introduction
I ran into a real challenge in creating my first state machine workflow for MOSS, so I thought I’d share a quick demo (OK, not that quick: it is a workflow, after all) and hopefully save you some time.

This will actually be a short series of posts covering the following topics:

  1. Concepts and planning (this post)
  2. Creating InfoPath forms
  3. Developing the workflow
  4. Deploying the workflow

Before you get started, you’ll need to make sure you’ve downloaded and installed the latest Office Server SDK (which comes with the Visual Studio workflow templates for SharePoint).

If you haven’t done any MOSS workflows yet, I’d check out Nick Swan’s blog post on a sequential workflow walkthrough -- I think that’s a good place to get introduced (and a good blog to add to your regular reading) -- then come back here and try your hand at a state machine.

Business Case
State machine workflows are good at automating processes that change between different states (or statuses) throughout the lifetime of the workflow. They have a defined beginning and end state, but the behavior in between those two points can vary based on inputs.

In this example, I’ll show a quick state machine representing a proposal creation process.
Let’s say Acme Widgets uses a proposal process to quote prices and sell its goods.

  1. Roger, the salesperson, prepares a proposal, which must then be reviewed by the sales manager, Sheila. 
  2. Sheila may either approve the proposal to submit to the customer, or she can kick it back to Roger for modifications. 
  3. If Roger has to modify it, he does so, and then sends it back to Sheila for approval. 
  4. Once approved, Roger submits the proposal to the customer and awaits the outcome.
  5. The customer can do one of three things:
    • Accept the proposal
    • Reject the proposal
    • Request modifications to the proposal

A graphical representation of the process looks something like this (click the image for a larger version):


The colored bands in the diagram represent the “state” of the workflow at a given point in time. This concept will be important when we actually design the workflow.

Side note: If you don’t do it already, I’d highly recommend doing a conceptual flow chart (similar to the one above) for your workflows. It doesn’t take long and offers clarity for you throughout the development process.

Note that the ability to go “backward” in the workflow is one of the factors that will determine whether you choose to implement a state machine workflow instead of a sequential one.

Planning
Based on the flow chart that I created, I can easily see what InfoPath forms I’m going to need to create for the various steps in the process.

  1. Association Form. Ok, this isn’t represented in the flow chart, but I know I’ll need to create one to set any association-specific information for my workflow.
  2. Initiation Form. This will be the one that is filled out when the workflow is first initialized.
  3. Review Form. This will be the form used by the proposal reviewer. It needs to have the option to approve the proposal or to send it back to the creator for modifications. In either case, the reviewer should have the option to add comments that will be written to the workflow history list.
  4. Modification Form. This form will be used by the salesperson to comment about any changes made to the proposal when re-submitting it for review. I can probably use the same InfoPath form as the initiation form here.
  5. Pending Customer Form. This form will be used to specify the outcome of the submission of the proposal to the customer. The possible options here are to send the proposal back for modifications, mark that the customer rejected the proposal, or (hopefully!) mark that the customer accepted the proposal.

At this point we’re ready to dive in. In my next post, I’ll walk through the steps of creating the InfoPath forms.

Nice post
By: Rahul | Posted: July 19, 2010 at 11:58 AM
Nice post Matt..Liked your explanation.. Here is a list of steps I documented while having hands-on on state machine workflows in SP 2007. http://rahul-vartak.blogspot.com/2010/07/sharepoint-2007-state-machine-workflows.html Hope this helps..!
RE: Workflow
By: Matt Morse | Posted: November 23, 2007 at 8:56 AM
Hi Cal, I used Visio 2007 to create the workflow diagram. I've found it pretty easy to get fairly nice-looking results with some rounded corners and gradient fills. :-) --Matt
Workflow
Posted: November 21, 2007 at 9:35 AM
Could you tell us what software you used to author the "Flow Chart", it looks really nice?
Part 4
Posted: October 5, 2007 at 12:58 AM
salam Tanks a lot for the state machine example,it's good but can u tell please where can i find the 4th part...
Good one
Posted: August 1, 2007 at 5:12 AM
Hi, Nice article.can u tell me when the rest article of this series will be available. Regards, Vipin Tripathi.
gr8
Posted: August 1, 2007 at 5:11 AM
Its nice one.Waiting for the rest articles of this series.
Unable to see the workflow in MOSS
Posted: July 12, 2007 at 9:58 AM
I have built a workflow (my first one) using Visual Studio 2005 Sequential Workflow template. I have been able to compile the workflow sucessfully and when i build the workflow, it goes through the deployment process without any error. I can see the folder for the workflow in the features folder. I can see the .wsf under the Centeral Administration --> Operations --> Global Configuration --> Solution Management. The WSF file for the workflow feature shows with a status of deployed and deployed to is set to "Globally Deployed". But when i go to a list settings and click on workflow settings, i am unable to see the workflow that i have deployed. I can't see the workflow even when i go to Site Actions --> List All site Settings --> Site Administration --> Site Features. I have MOSS2007 installed on windows 2003 running on SQL Server 2005 as backend. Any idea what i am might be doing wrong. Is there is switch/flag that i have to set to see the workflow? any help is greatly appreciated. Thanks. Jamali
Very Impatient!!
Posted: May 31, 2007 at 12:26 AM
Hello Matt, your bolg is very good and interesting, I am very impatient to read the next posts on this topic. Regards
Modification forms
Posted: May 21, 2007 at 11:29 AM
Hi, I'm looking forward to reading the rest of this series. I've been trying to get modification to work on a state machine workflow for a while now. So far I've only been able to get modification to work with a sequential workflow, not with a state machine workflow. Are there any special steps you need to complete to use modification forms with a state machine workflow? Thanks.
Suggestions
Posted: May 17, 2007 at 5:07 PM
Hi, Instead of using InfoPath forms, would it be possible to use ASPX custom form within a WSS site? There are few samples using this approach but a lot of requests since IP means a Form server and other stuff. Thanks in advance
 

 About Matt Morse

Practice Manager - SharePointMatt Morse is a practice manager for PointBridge. He has over 10 years of experience in application architecture and development, working in a variety of industries, including banking, manufacturing, ... [more]

 Tag Cloud

 My Articles

 ‭(Hidden)‬ Admin Links