Designer > Using Variables > Adding a Variable

Adding a Variable

Define a new process variable based on a type.
You can add message type variables to your process automatically when you create a receive, pick, invoke, event handler, or reply activity from a WSDL. For details, see Creating an Activity by Starting with a WSDL Interface.
You can also add variables to your process manually. Before manually adding a variable, ensure that an appropriate WSDL namespace is defined. For more information, see Importing WSDL, Schema, and Other Resources.
You can declare global variables, accessible by the process as a whole, and you can declare local variables for use within a scope. A local variable can have the same name as a global variable, and if it has the same name, only the local variable is accessible within the scope.
To define a global variable:
  1. 1. In Outline view, right mouse click on Variables and select Add > Declaration > Variable.
  2. 2. Double-click the new variable, or in the Properties view, click Dialog (...) to open the Definition dialog.
  3. 3. In the dialog, select the variable type:
  4. 4. Select the name you need from the list that appears, and click OK.
To add an initial value to a variable, see Initializing a Variable.
To define a local variable:
  1. 1. Select a Scope from Outline view.
  2. 2. Complete Steps 2 - 4 above.
Variables are listed in the order they are created. To re-order the list, move a variable up or down in the Outline view.

WSDL Message Types

A WSDL message type variable uses a message type declared in a WSDL namespace that is referenced in your process.
The following illustration shows an example of a variable defined as a WSDL message type. The message type namespace is declared in the BPEL process.

XML Schema Type

An XML schema type variable uses a simple or complex type of element built into the schema of the currently defined namespaces. For example:
<variable xmlns:props=""
name="itemsShipped" type="props:itemCountType"/>

XML Schema Element

An XML schema element variable uses an element defined in the schema of the currently defined namespaces, as shown in the following example.