Create your first SOA Composite - Hello World ! Process
Start JDeveloper. Left click Applications node in the Applications Navigator and select New Application, as shown
Create an Application named Training.
Give “Training” in Application name
Select a suitable location and select SOA Application in the Application Template
The wizard now prompts you to create a project. Later, you can add more projects to this application.
Give the project name as HelloWorld
Select Composite template as Composite with BPEL Process. This is a convenient shortcut to tell that the composite we want to create would contain one BPEL process. As an alternative, we can choose Empty Composite here, add add a BPEL
component later.
Click on Finish
A new dialog opens up. This is to configure the BPEL component that we are adding to our composite.
Give name as HelloWorld_BPEL
Select Template as Synchronous BPEL Template and click ok.
Templates are pre-defined structures provided by Oracle. Essentially, by using a template, a few activities shall come by default, so that you are saved of the mundane steps of adding those activities. It’s even possible to create your own custom templates. As of now, we select the predefined template for a synchronous process. A synchronous process is one which is expected to be comparatively short-lived (few seconds to minutes) and hence can be expected to return a response quite quickly. So, the client invoking a synchronous process can afford to wait (and block) for the response to come back.
The following structure comes up.
This is the picture of the composite (more technically, it’s the design time view of composite.xml). As you can see, it contains a servicecomponent called HelloWorld_BPEL and a binding component called helloworld_bpel_client.
Service components are the building blocks that you use to construct a SOA composite application. Examples - BPEL, Human Task, Business Rules, Mediators, Spring.
Bindingcomponentestablish a connection between a SOA composite and the external world. They are categorized as Service binding component and Reference binding components. Service binding components provide the entry point to the composite Reference binding components provides access to the external service in the outside
world. Examples include JCA Adapters (FTP adapter, DB adapter, Apps adapter etc), HTTP Binding, Direct binding etc.
Double click on this component to open it up.
As you can see, there is an input coming from the helloworld_bpel_client service binding (which represents any client that is invoking our BPEL process).
Drag an Assign activity from the component palette on the right.
In this assign activity, we can add any number of “Copy rules”. Copy rules allow us to copy values from a source variable to a target variable, or to assign result of an expression (say a concatenate operation or a square root operation) to a target variable.
We want to create an expression similar to
“Hello” + Input = Output.
This we shall create using the following steps:
Expand output variable so that you can see client:result. This is the string field to which we want to assign some value.
From the icons on top right corner, drag an expression onto client:result.
A dialog called Expression Builder opens up. Expression builder is a nifty tool to quickly create expressions. It shows categories of operations. You choose a category and it shows you the expressions within that category. For example
Here we choose “concat” function from the String Functions category
Click on Insert into expression. This puts the concat() into the Expression box above. (When you get experienced, you can simply write functions directly here.). Place the mouse cursor between “(“ and “)” of the concat function
Next we expand the input and select the client:input field. This is the field that has got the value that was sent by the user. We want to append hello to this and assign that to the output variable. So choose this
Press Insert into expression
Type ‘Hello’ followed by a comma. Note that in BPEL, (or more precisely xpath) we use single quotes for strings
Now press OK. Control returns to Edit Assign dialog. Now expand the outputVariablein the To section (right section) and select client:result field. Press OK
This has completed the Assign activity. For better readability we should always give descriptive names to activities.
So double click on the text “Assign1” (not the icon) and give name as “Assign_Hello”
The BPEL process is now complete !
'SOA' 카테고리의 다른 글
Persistence Properties in Oracle SOA 11g (0) | 2015.01.08 |
---|---|
JDeveloper-Creating a Simple BPEL Process (0) | 2014.11.24 |
Configuring Transaction timeout in BPEL (0) | 2014.10.20 |
How to run RDA for weblogic (0) | 2014.09.24 |
Oracle SOA Suite 11g, Resequence message in Mediator (0) | 2014.09.19 |