In this article, I will show quickly how to do a HelloWorld program in BPEL. Of course this example will be kept very simple.
Why this example?
To show you how to create a BPEL Project
To show you how to deploy and test the BPEL Project
To explain the basic components of a BPEL Project
Explain why Oracle designed BPEL/ESB in this manner, and its benefits
Will all the above be covered in this specific article?
To keep things simple, I will split the above listed tasks into streamlined but concise articles.
What this article will not include
a. This will simply show you step by step approach for creating HelloWorld.
b. Testing steps will be explained in a future article
c. I will explain the internals of these BPEL components in a latter article.
d. Invocation of a third party web service. I will cover this latter.
e. Concepts of ESB for example Message Transformation, Rules based routing etc.
f. Database related transactions/flows
I hope that you have already read and implemented article Connecting jDeveloper to SOA Servers.
What is the scenario painted by this article?
1. Each default BPEL Process has two variables in addition to having a receiveInput[start] and replyOutput[end]
The two variables are input and output[result]
2. We will add two stages to this Synchronous process
3. Stage 1 will Alter the value of input variable itself by concatenating text Hello From Anil Passi to .
4. Stage 2 will assign the value in input variable to the output variable
Lets get started with steps for BPEL HelloWorld
Step 1. Select Application Navigator Tab and right click on Applications to create a new Application. Give it any name you desire.
Step 2. Right click on that Application and create New Project of type BPEL Process Project. Give it a name HelloPassiWorld
Important:- Make sure that the template is Synchronous BPEL Process
Step 3. Click on Next, accept all defaults and click on Finish.
Step 4. You will now see a default flow created.
In the right hand side top of the window, select "Process Activities"
Step 5. Click on Assign within Process Activities. Drag it between receiveInput and replyOutput.
Do this step twice. Your flow will look as below.
Step 6. Double-click on Assign_1. A window will pop-up. Select tab Copy Operation, then click on Create and then click on Copy Operation again.
You will see another window pop-up with title Create Copy Operation.
It has two sections From and To.
Step 7. In the From section, select Expression and hit control-space. Select concat
Enter text as below, and navigate cursor to after comma and hit Control Space again.
Step 9. Select bpws:getVariableData with 3 input parameters.
Keep on hitting Control Space and keep selecting default values for parameters to concat method.
Step 10. In Right hand side, select Variable and expand the section to select client:input.
Step 11. Click on OK and Apply and again OK.
Step 12. DoubleClick on Stage_2 this time. and again use Create Copy Operation.
Step 13. Assign the Input Variable to the Output Variable. Note that we have modified the value of the input variable.
Step 10. Click on OK and OK again and save the project.
Step 11. Right click on the project and select Rebuild
You should receive something similar to below text in Message tab[once rebuild is completed]
BPEL suitcase generated in: C:\jdev\jdev\mywork\Application2\HelloPassiWorld\output\bpel_HelloPassiWorld_v2007_01_08__3624.jar
copying bpel/HelloPassiWorld.wsdl to output directory
converting, through native2ascii, build.properties to output directory
[01:01:28] Successful compilation: 0 errors, 0 warnings.
Right click on the project and Deploy it to the BPEL Server as below.
Deploying to http://localhost:8888 domain: default. Please wait....
[1:10:15 AM] Please check Ant log to determine whether the project deployed successfully.
Ant Log is
| Deploying decision services for HelloPassiWorld on localhost, port 8888
[deployDecisionServices] There are no decision services to deploy
Total time: 2 minutes 16 seconds
This completes your HelloWorld Project in BPEL.
In the next article I will be explaining how to test this project.