Creating a BPEL Process as a Service for Another BPEL Process
Creating a BPEL Process as a Service for Another BPEL Process
A BPEL process uses an invoke activity to call out to a Web service to perform a task. You can create a BPEL process for this purpose.
You can choose between two different invocations of a process:
Standard
process
that behaves like a normal endpoint reference
When you create a process deployment descriptor, you can select any process as a static endpoint reference for a partner role. This avoids the overhead of the server composing a SOAP message for dispatch through the standard invocation layer. The message is sent directly to the engine instead.
Subprocess
of the calling process that is eligible for process-level compensation and termination handling
When you create a process deployment descriptor, you can select any process:subprocess as a static endpoint reference for a partner role. This lets the subprocess participate in process-level compensation and termination handling.
More about Subprocesses
A subprocess is subject to the fault and compensation handling rules of the enclosing scope of the parent process from which it is invoked. A subprocess is compensated whenever either the fault handler or the compensation handler for the scope enclosing the invoke activity is run. This work is performed implicitly. However, you can enable process-level compensation and termination for the subprocess to select what compensation and termination tasks to do. For a discussion of compensation, see
Compensation
.
The enclosing scope for the invoke activity does not complete until the subprocess completes. If the subprocess is compensatable when it completes, the enclosing scope compensates the subprocess during its compensation.
If the subprocess throws a fault, the invoke activity of the parent process faults.
Creating a Process as a Service
To create a BPEL process as a service, you must do the following:
Add a WSDL file to Project Explorer for the BPEL process. There are many ways to create a WSDL file.
See Interfaces, Service References, and Local WSDL
.
Create the BPEL process to be used as a service.
If desired, set the process property Process Level Compensation/Termination to Yes. Two additional tabs are added to the Process Editor, and you can add compensation and termination activities to them. The following illustration shows the tabs that are added to Process Developer.
In the Process Deployment Wizard, identify a service name for the My Role partner link, just as you would for any process.
Create a business process archive (.BPR), as described in
Deploying Your Processes
.
Deploy the process to the server.
Create the main process that invokes the BPEL process using an invoke activity.
In the Process Deployment Wizard for the main process, do the following for the Partner Role partner link:
Select process or sub-process as the invoke handler.
Select static as the endpoint reference.
Select the
Dialog
button to fill in the sub-process information.
Deploy the main process.
When the main BPEL process is running, and it invokes another BPEL process, the invoked process has the status of a subprocess, with its own state information. The main process awaits the completion of the subprocess before continuing its own execution. For more information on actively running processes, see the