Chapter 10 Working with BPEL4WS
Requirements
When to work with BPEL4WS?
You define a BPM with the BPEL4WS process language when you need to implement with the BPEL4WS standard language in order to share your business process model.
Scenario
The scenario could be the following: You have already defined your organization in terms of processes and sub-processes at an analysis level and you want to automate all or a part of these processes:
- Generate a BPEL4WS model using the Model to Model generation feature to obtain a skeleton of an orchestration model
- For each top-level process determine a logical associated partner with which the process will exchange information or service using organization units and role association objects
- Import WSDL files or components to design applications using service providers, service interfaces, operations and messages. Otherwise you can create these objects by hand or even wait later on to design your needs
- For each atomic activity in the graph of top-level processes, define an implementation using an existing operation or one that you create. To do so, you must at first create a service provider then a service interface. For each process implemented by an operation, you must also precise which partner is going to execute the operation by selecting an organization unit among the partners you have previously defined
- You can also consider that an activity could be decomposed into sub-graphs in order to detail its implementation more precisely. To do so, you transform the atomic activity into a composite activity.
- Concerning error handling, you may have defined at the analysis level an error handling (generally designed by an outgoing flow with an error condition). If this error is designed by a Fault message in the operation associated with the activity, you should replace the condition on the flow with an event object with a <<Fault>> stereotype. The event object should have the same name as the fault of the operation
- You can also create an activity to notify a logical error that must be handled by a parent process. To do so, you must create an event object with a <<Fault>> stereotype and associate this event with the activity using the Generate Event implementation type in the process property sheet. Then, on one of the parent processes, you must add an outgoing flow linked with the event object in the Condition page of the flow property sheet. The destination process of the flow will correspond to the start of the graph for error handling. This approach allows you to factorize the handling of an error that can often occur at different levels
- Within a graph for error handling, compensation is often required to cancel the effects of a process that has already been performed. To do so, you use an event object with a <<Compensation>> stereotype and associate this event with the activity asking for compensation, as you did it for Fault event
- Once the implementation of all atomic activities is defined, you can export them in an OOM to specify in that model the implementation of services. The BPM helps you to specify business needs only
- Once the choreography of the different activities is defined you must specify the data management. For each activity implemented by an operation, you must retrieve messages received in local variables. To do so, you must select a variable or create one in the Received Message groupbox of the Implementation page of the process. Same for messages sent by the process, you must select a variable or create one in the Sent Message groupbox of the Implementation page of the process.
- You may need to transform existing information to build the message to be sent. To do so, you must use the data transformation object. The result of the transformation is stored into a variable (Assigned Variable box in the data transformation property sheet). Input data can be a variable on which you will perform a simple transformation using XPath or a more complex transformation with several variables using XSLT
- Concerning expressions used in conditional branching, you must transform the pseudo code used at the analysis level for decisions or expression on flows into an expression that can be evaluated by the process engine. Usually XPath expressions using local variables, you will have to type them by hand or build them in an external editor and copy them in PowerDesigner. You may need to create additional variables and data transformation objects
- For each reception of message, the process engine needs to know to which process instance the message must be assigned. To do so, you use the correlation key object, which is a unique key built from values of variables local to the process. You must associate each process implemented by an operation with a correlation key object. You may need to create additional variables and transformation objects. The first received message in the graph of activities is the "exception" message. It creates an instance of the process and does not need a correlation key object
- You can then check your model to detect errors or missing before you generate your BPEL4WS file
Copyright (C) 2008. Sybase Inc. All rights reserved.
|
|