Using the Expression Editor
Use
You can define expressions to access a specific field of a message (payload element) with the expression editor.
Features
Define Constants
You define constants to define the comparison value for a condition, for example.
-
Enter a name for the constant.
-
Select the corresponding XSD data type.
More information: XSD Data Types
Access a Field in a Message
Access a Field in a Message
If you want to access a particular field of a message, you can do so by means of a context object or by using XPath.
Specify Context Object
-
Select the required interface variable.
-
Define how the field is to be accessed:
Select the corresponding context object.
The expression editor shows the context objects that are defined for the relevant service interface, and the technical context objects (namespace http://sap.com/xi/XI/System).
It also shows the context objects for all existing adapter-specific message attributes in the message header.
The namespace for adapter-specific attributes is structured as follows:
<Namespace of the adapter metadata object>/<Name of the adapter metadata object>
Pay particular attention to this convention when developing your own adapters (which you develop in a separate namespace).
All adapter metadata shipped by SAP is located in the namespace http://sap.com/xi/XI/System . The namespace for the context objects of these adapter-specific attributes is therefore structured as follows: http://sap.com/xi/XI/System/<Name of the adapter metadata object> .
Specify XPath Expression
-
Select the required interface variable.
-
Define how the field is to be accessed:
To use XPath, expand the structure of the message and double-click the required field.
If the field contains a structure, select Multiline .
If the element in the message that you want to access is qualified by a namespace, you must give the namespace a prefix. The prefix is then used as an abbreviation of the namespace in XPath expressions.
To specify a prefix-namespace pair, add a new line in the table under the XPath expression and assign a prefix to a namespace ( Prefix and Namespace columns).
If you transfer an XPath expression from the structure of the message, the corresponding prefix-namespace-pair is created automatically.
Notes Regarding the Use of XPath Expressions
Note that XPath expressions created with the expression editor can only return items of type node (node, node set). For technical reasons, other types (such as Boolean value ) are not permitted.
To formulate more complex logical expressions and conditions, you can use Predicates (syntax components in angle brackets) in XPath expressions.