About Variables in the BPEL Designer
See Also
Variables in BPEL programming function just as they do in other programming languages: they hold temporary values, form parts of expressions, or are passed
as parameters to external partners. Normally, you need a variable for every message sent to or received from a partner service. The BPEL Designer supports the following types of variables:
- WSDL Message type. These variables correspond to web service message types that are defined in WSDL files imported by the process. In a BPEL file (.bpel), these variables must specify a value for the messageType attribute. Message type variables are used to hold data in interactions between the process and its partner services.
- XML Schema type. These variables correspond to simple or complex XML Schema data types. The XML schema types themselves are defined in XML Schema files (.xsd) or in WSDL files that are imported into the process. In a BPEL file, variables of this type must specify a value for the type attribute.
- XML Schema element. These variables correspond to XML Schema elements.The XML schema elements themselves are defined in XML Schema files (.xsd) or in WSDL files that are imported into the process. In a BPEL file, variables of this type must specify a value for the element attribute.
- Built-in type. Variables of this type are standard simple types defined in the XML Schema specification.
Global and Local Variables
The variables defined at the Process root are global variables which have global visibility throughout the entire process. However, the variables defined within a particular Scope are visible only inside that Scope and all nested Scopes. These variables are called local variables. A variable defined for an inner Scope element can hide an upper defined variable of the same name.
The name of a variable must be unique among all variables defined within the same Scope.
Using Variables
Follow these basic steps to use variables:
- Define a variable for the Process or for a Scope element.
- Select the variable to serve as an input or output variable for specific elements. For example, Message Type variables can be used for Invoke, Receive, and Reply activities.
Copying Variable Data and Creating Expressions
You can copy data from one variable to another variable using the BPEL Mapper. See Creating BPEL Mappings for details about copying data.
Using the BPEL Mapper you can also create an XPath 1.0 expression for a business process element that requires this expression.
Refactoring
The BPEL Designer automatically synchronizes the names of defined variables and their usages. For example, when you rename a variable, all its usages are adjusted automatically to reflect the new name, including the usage of this variable name inside XPath expressions. See Refactoring in BPEL Processes for details about the refactoring rules in the BPEL Designer.
- See Also
- Creating Variables
- About the BPEL Mapper
- BPEL Designer Navigator: BPEL Logical View
Legal Notices