wftk tutorial - 07 State-based workflow (state machines)

So here we are at Chapter 07, and we finally get to specify some workflow! There are two basic models of workflow: state machines and procedural definitions. It's really arbitrary which we cover first, but state machines are more familiar to the open-source community, so I chose to start there. Besides, they're somewhat simpler than the procedural model, since their only elements are states and transitions.

Each process has a state, as you'll recall from Chapter 05. The state is a privileged variable that is stored in the process index, and changes to the state are called transitions. There is plenty of literature about state machines, so ask Mr. Google if you're interested in more detail. From the perspective of the wftk, that's basically all you need to know.

In state-based workflow, the system uses the process's state to decide what potential tasks exist. The difference between the concrete tasks covered in Chapter 05 and a potential task is straightforward: a concrete task is a specific statement that a given action must be carried out, whereas a potential task is a statement that a task can be carried out (or, as we'll see in the next chapter, that the task might be carried out).

When a potential task is carried out, the system changes the state, and the other potential tasks in that transition go away, to be replaced with whatever potential tasks are provided by the new state. In purely state-based workflow, each potential task represents a possible state transition, and the sequence of transitions (i.e. tasks completed) describes the process's trajectory around the network defining the process. It would be nice if the wftk also provided convenient tools for generating said diagrams, but so far that is not on the table.

Note that I said "purely state-based workflow" back there. In actual practice, the exclusive use of transitions is somewhat restrictive, so most actual workflow systems using the state-based paradigm end up defining hooks for actions to be taken before or after the transition. These hooks are convenient, but the wftk uses a full procedural paradigm in this case -- see the next chapter for more information.

Here is an index to the information in this chapter:

(unresolved tag 07-index)





Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.