Business Process Execution Language(BPEL) is an execution language for defining business processes. In short, it is the language for orchestrating multiple WebServices based on the business logic.
This post is about creating your first BPEL process using Oracle SOA Suite 11g
This is a simple BPEL process that gives back fullName as response, inputs being firstName & lastName
Defining your first BPEL Process
Create a new Project, name it HelloWorldBPELPrj and select Empty Composite in the next screen'
Define a Schema as follows
In the composite file, drag and drop BPEL Process component from the Component Palette into the Components swimlane of the composite.xml
This will open up a wizard where you need to give the following details
Name : HelloWorldBPEL
Template : Syncrhonous BPEL Process
Select Input and Output from the schema just created
Select the checkbox "Expose as a SOAP WebService" so that it creates a WebService with the same message types in the External References section of the composite.xml, though which external clients talk to this BPEL process
This will create the following in the composite.xml
Now that you've created the skeleton, lets implement the BPEL process.
Either open the .bpel file from the Navigator or double click the BPEL process icon in the coposite.xml - this will take you to the BPEL Component Editor where you'll implement the business logic in the BPEL process
When you look at the empty BPEL process, you'll find an incoming line from the external WS to Receive Activity, and an outgoing line from Reply Activity to the same external WS. These lines represent the flow of message to and from the WS to the BPEL Process
Note : Every operation in a BPEL process is called an Activity
Click on the "X" symbol in the boundary enclosing both the activities. The boundary is called a Scope in BPEL, which is similar to Scope in any programming language
This will open up variables section, where you'll see 2 variables (inputVariable and outputVariable). The inputVariable contains the the value coming into the BPEL process from the external WS.
In this example, inputVariable contains just a simple string, name
We need to concatenate this with 'Hello ' and assign it to the output variable. This can be done using Assign activity
Drag and drop Assign activity in between the two activities, name it AssignOutput
Here, we need to concatenate both the elements from the input and assign it to the output. For this, click on the Expression icon at the top right as shown
Use the concat() function from the String functions and append Hello to the name from the inputVariable, as shown
This will create a function icon in the middle of the Assing editor, where you need to drag this to assign it to the returnMsg of the outputVariable and click OK
With this, the outputVariable is stuffed which is sent back to the calling WS(indicated the outgoing line)
Thats it, you are done with your first BPEL process
Deploy the project as per this link and test it in Enterprise Manager
Hope this tutorial gave you a basic understanding on working with a BPEL process.
Thanks for going through my post, feel free to provide a feedback!
Superb Article on BPEL. Keep going...ReplyDelete
Thanks for thisReplyDelete
Thank you. Really helpfulReplyDelete
Really helpful for beginners. thank you very muchReplyDelete
Thank you a lotReplyDelete
Thank a lotReplyDelete
wonderful...thanks for sharingReplyDelete
superb article.. thanks a lot...ReplyDelete
superb article.. thanks a lot.ReplyDelete
Nicely proposed!! Thanks:)ReplyDelete