Last week, we looked at process lifecycles. This week, we'll take a look at the assign and other basic activities, and study flow. This article, the fourth in a series, is excerpted from chapter 12 of Building Web Services with Java: Making sense of XML, SOAP, WSDL, and UDDI, written by Steve Graham et al. (Sams; ISBN: 0672326418).
Graph-oriented constructs are a common approach for controlling the flow of execution of several activities. The BPEL flow activity lets you define a collection of activities, parts of which may be performed in parallel. Activities in a flow can be wired together via links that specify the execution order between activities, including the synchronization of parallel execution branches within that flow. Furthermore, transition conditions determine the branches of a flow to be navigated, and join conditions specify requirements about parallel branches joining at an activity; they need to be fulfilled to execute that activity.
In SkatesTown's purchase order process, a flow activity controls the main processing of the purchase order, starting with its validation and finishing with the creation of the invoice and the initiation of the order's delivery:
Some activities of this flow must be performed before others, for example, validation needs to happen first.
Some activities can be executed in parallel, such as the creation of the invoice and the initiation of the delivery.
The flow also uses transition conditions. For example, based on the result of the validatePurchaseOrder activity, processing of the order either continues normally or is discontinued by throwing the fault invalidPO.
Figure 12.5 outlines the graph of this flow; its activities are represented as nodes, and its links as edges.