Create a new BPEL project named “BPEL_Pick” by selecting File→New→Others→BPEL 2.0→BPEL Project. Select Next. Type the project name as BPEL_Pick and select the Target Runtime as Apache ODE 1.x Runtime. Click Finish.
Create a new BPEL process file named PickSample
by right clicking on the BPEL_Pick/bpelContent
folder, select New→Others→BPEL 2.0→New BPEL Process File
. Click Next
. Fill in BPEL Process Name the stringPickSample
, and in the Namespace the string http://pick.bpel.tps
. Select the Template as Synchronous BPEL Process
. Click Next
Open the PickSampleArtifacts.wsdl file in your project. Right click on the PickSample Port Type. Select Add Operation.
Rename the new operation as sayGoodbye
. Rename the existing operation from process
Open the Outline→Bindings→PickSampleBinding
. In the Properties
view. Click Generate Binding Content..
. Keep default declaration, select Overwrite existing binding Information
Open the PickSample.pbel file to design the process. Click and drag the Pick activity from the Palette to the process before the receiveInput activity.
In the Details tab of the Pick activity, select the option Create a new Process instance if one does not already exist.
Remove the receiveInput
activity and move the replyOutput
activity to the OnMessage
event, inside the Pick. Click and drag an Assign
activity to the process, before
the replyOutput. A Sequence is automatically created.
Click on the OnMessage
activity. In the Details
tab, select the operation sayHello
Right click on the Pick
activity. Select Add OnMessage
. In the Details
tab, select the operation sayGoodbye. Add an Assign
activity and a Reply
activity to the sayGoodbye branch.
Click on the Reply
activity of the sayGoodbye branch, in the Details
tab, assign the PickSample→sayGoodbye→sayGoodbyeResponse→parameters→out
to the clientResponse
The same way with the replyOutput activity, assign PickSample→sayHello→PickSampleResponseMessage→payload→result to the output variable.
Click on the Assign
activity, select Details→New
. Assign the expression concat(“Hello ”,$input.payload/tns:input)
to the output→payload→result
variable. A pop-up dialog appears asking you about the variable initiation. Select Yes
The same way, at the Assign1 activity, assign the expression concat(“Goodbye ”,$clientRequest.parameters/tns:in) to the clientResponse→parameters→out variable.
It’s now finish the design part. Verify that there is no error in the dessign. We move to the service declaration and registration.
Right click on the BPEL_Pick/bpelContent folder, select New→Others→BPEL 2.0→Apache ODE Deployment Descriptor. Click Next. Verify the BPEL Project name as /BPEL_Pick/bpelContent. Click Finish.
Open the deploy.xml file. And select the Associated port with the Partner Link client is PickSamplePort.
Save file and open the Server view, right click on the Ode v1.x Server at localhost, select Add and Remove Projects. Select the BPEL_Pick in the Available projects box and click Add. Then, click Finish.
Start the ODE server and use the Eclipse’s Web Services Explorer
to test our application. You will see two operations sayHello
that you can select to use. Depending on the operation you select, BPEL will execute the respective process.