Defining global variables in a BPEL process

This recipe describes how to define a global variable inside a BPEL process in Oracle SOA Suite.

Getting ready

There are no special preparations required for this recipe. We create a project in JDeveloper with an empty synchronous BPEL process.

How to do it…

In the following steps, we will show you how to add a global variable to a BPEL process in JDeveloper:

  1. We start by opening the BPEL process in JDeveloper. We then select the scope of the BPEL process. Note that it will be highlighted blue. We then select the variables icon in the BPEL process toolbar as shown in the following screenshot:
    How to do it…
  2. The dialog opens with the variables listed for the specified scope. We click on the plus (+) sign in the dialog as shown in the following screenshot:
    How to do it…

    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.

  3. The Create Variable dialog opens which is divided into three sections. We enter the variable name, select the variable type, and click on OK.
    How to do it…
  4. The newly defined variable is listed in the variables dialog and we click on the OK button. Now the global variable is defined in the BPEL process.

How it works…

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>

There's more…

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:

There's more…

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.

There's more…

Creating the variable dialog

The dialog opens whenever we click on the plus (+) sign. It is divided into three sections as shown in the following screenshot:

Creating the variable dialog

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.

Note

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

See also

  • To define local variables in a BPEL process, refer to the next recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset