Workflow Design Pattern Series - Control Flow Perspective
Workflow design patterns have become very popular and Organizations have been leveraging it to make a decision on which workflow solution to choose and how to design the Workflow System. Wil van der Aalst, Bartek Kiepuszewski, Alistair Barros, Arthur Hofstede are some of the people who originally coined the idea and made workflow patterns popular. This post references a lot of definitions from the site http://www.workflowdesignpatterns.com
The Design patterns are classified into the following types based on perspectives
- Control Flow perspective
- Data Perspective
- Resource Perspective
- Exception Handling perspective
In this Part of this four part series we will look at some of the Control Flow patterns
A Task in a process is enabled after completion of a preceding Task in the same Process. Also known as Sequential Routing and Serial Routing. The Sequence pattern serves as the fundamental building block for processes. It is used to construct a series of consecutive tasks which execute in turn one after the other. Two tasks form part of a Sequence if there is a control-flow edge from one of them to the next which has no guards or conditions associated with it. An Example could be The verify-account task executes after the credit card details have been captured.
Implementing this pattern is fairly simple. Lets see a Simple Credit Card checkout process which uses this pattern
In the Example above we have used a Simple E Commerce Checkout process to show you how this pattern works. Only after choosing a product checkout can be done. Similarly after checkout payments can be done.
Almost all the workflow tools that we have supports this pattern. Probably the most simplest and obvious one.
The divergence of a branch into two or more parallel branches each of which execute concurrently. Also known as AND Split- Parallel Routing, Parallel Split or fork. The Parallel Split pattern allows a single thread of execution to be split into two or more branches which can execute tasks concurrently. These branches may or may not be re-synchronized at some future time. An Example could be When an intrusion alarm is received, trigger the despatch patrol task and the inform police task immediately
For implementing a parallel split, you will need to provide a block with one incoming edge and one outgoing edge. A number of tools provide a split workstep which can be used for this. Lets see the example of Identity Management System which allows a user account to be setup
In this example, the first step is to create an Active Directory ID for the new Joinee. Then there are two parallel processes which are to create an SAP (ERP) ID and the other is to create a Mainframe (Trading System) ID. Both of these can run parallel to each other.
Often this pattern is accompanied by a Join in the later stages which acts as a Synchronization point.
The convergence of two or more branches into a single subsequent branch such that the thread of control is passed to the subsequent branch when all input branches have been enabled. Also Known as the AND – Join, rendezvous, synchronizer. Synchronization provides a means of re-converging the execution threads of two or more parallel branches. In general, these branches are created using the Parallel Split (AND-split) construct earlier in the process model. The thread of control is passed to the task immediately following the synchronizer once all of the incoming branches have completed. For Example The despatch-goods task runs immediately after both the check-invoice and produce-invoice tasks are completed.