In the samples Hello World and Service Invocation, we used sequence activities to structure our business process.
A sequence activity is a structuring activity. It contains one or more activities that are performed sequentially, in the order in which they are listed within the sequence element.
If you need a more advanced control flow in your business process, you can use a flow activity. A flow activity contains a set of concurrent activities. That means that by default, all activities contained in a flow element are executed in parallel.
Furthermore, it enables the definition of control links between activities to synchronize activities and determine their execution order.
A link has one source activity and one target activity. The link's target activity is executed after the link's source activity.
It is possible to associate transition conditions to links. After the link's source activity has been executed, the transition condition is ready to be evaluated. When all source activities of a target activity have been processed, the system evaluates the join condition of the target activity. Depending on the join condition, the transition conditions of the links are evaluated and the system decides if the target activity will be processed or skipped.
A transition condition can be implemented using Java code or an XPath expression.
The scenario for this sample is a customer's application for a new account at a bank. The bank's decision whether or not the account may be opened depends on the result of a credit rating check. If the customer has a good credit rating then the bank will create a new checking account and a new savings account. Otherwise, the request has to be denied.
The following activity diagram describes the execution of the different activities within this business process as a result of the initial credit rating check:
There are multiple possibilities to model the above business process in BPEL.
In this sample, we want to use one single flow activity that contains all activities. To model the control flow between the activities, we use links. See the BPEL Process section of this sample for more information about the BPEL process model.