This recipe describes how to define a global variable inside a BPEL process in Oracle SOA Suite.
There are no special preparations required for this recipe. We create a project in JDeveloper with an empty synchronous BPEL process.
In the following steps, we will show you how to add a global variable to a BPEL process in JDeveloper:
When BPEL is created through the BPEL process wizard in JDeveloper, we notice that it already has two global variables defined, one holding the request message and another one holding the response message.
Remember that the global variables belong to the outermost scope. After the definition of the global variable, we check the source of the BPEL process. We see that the new variable was defined in the section of the <variables>
tag within the <process>
tag and immediately after the <partnerLinks>
tag as follows:
<variables>
<!-- Reference to the message passed as input during initiation -->
<variable name = "inputVariable" messageType = "client:BPELProcessGlobalVarRequestMessage"/>
<!-- Reference to the message that will be returned to the requester-->
<variable name = "outputVariable" messageType = "client:BPELProcessGlobalVarResponseMessage"/>
<variable name = "inputConcate" element = "client:process"/>
</variables>
Another way of defining a global variable is to insert the preceding code manually intothe BPEL source code. We can also define a global variable from the BPEL process toolbar.
We select the icon from the BPEL process toolbar as shown in the following screenshot:
A slightly different dialog opens containing the variables defined in the BPEL process. We define the variable the same way as in the recipe by clicking on the plus (+) sign.
The dialog opens whenever we click on the plus (+) sign. It is divided into three sections as shown in the following screenshot:
The topmost section is used to define the variable type. Remember that it can be either simple Type, the Element type, or Message Type. The middle section is used in case we want to define Entity Variable, which has its origin in Partner Link:. The bottom part presents the checkbox SDO Capable, which identifies Service Data Object (SDO) capable of utilizing the content from different sources through the Data Access Service (DAS), which enables access to data without knowing their real underlying implementation. The difference between the SDO variable and the standard DOM variable is in their underlying presentation. Hence, the different features are available to both types of variables.
More information on the SDO capability and DAS can be found at the following URL:
http://docs.oracle.com/cd/E23943_01/dev.1111/e10224/bp_manipdoc.htm#SOASE85027