Java Reference
In-Depth Information
Creating a BPEL Process That Invokes a Partner
Problem
You want to create a complete, real-world type process that accepts input from a client, does
some BPEL work, and invokes a partner web service along the way.
Solution
Even creating a “Hello World” process in BPEL is somewhat labor-intensive. The following
steps create a basic orchestration that only invokes one service to return a response:
1. If you don't already have a web service or a set of services to invoke as part of the applic-
ation, create one.
2. Create a BPEL project in your IDE. Add the WSDL of the web service your orchestration
will invoke and any schemas it uses to your project. Create a .bpelfile.
3. Build the orchestration. There are several basic activities to perform to do this. You need
to create a partner link that represents the client-facing aspect of the orchestration. Then
create a partner link for the services you're going to invoke. Then start building the pro-
cess a container such as a <sequence> and add activities to it. At minimum, you will need
to <receive> incoming messages, <assign> the incoming message to a variable you can
pass to the service you're going to invoke, then <invoke> the service, and <assign> its
response to an outbound message that can be used in a <reply> back out of the orchestra-
tion to the client.
NOTE
Creating such a process is a very good way to start with BPEL. It covers all of the basic functions
of an orchestration, and it gives you a simple and flexible base where you can experiment with more
elaborate capabilities such as fault handling, correlation sets, and so forth. However, from a design
point of view, the orchestration just shown is a pretty bad example. There is little point in creating
a BPEL that just invokes another service. If you want a layer of indirection between your client and
your service, that's what ESBs and other mediators are for—it is not the purpose of orchestrations.
Orchestrations are intended to represent business processes that have a variety of steps requiring de-
cision points and that may be long-running. So the example outlined in this recipe is a great way to
start learning BPEL, but a not a great example of how to use orchestrations.
Search WWH ::




Custom Search