Trading Networks 10.3 | Administering and Monitoring B2B Transactions | Service Development Help | Conditional Expressions | Syntax
 
Syntax
 
Comparing Java Objects to Constants
Verifying Variable Existence
When you create an expression, you need to determine which values to include in the expression. Values can be represented as variable names, regular expressions, numbers, and Strings. The following table identifies the types of values you can use in an expression and the syntax for each value type.
Value Type
Syntax
Description
Regular Expression
/regularExpression/
Pattern-matching string. Use the following syntax for pattern matching of variable values:
variableName = /regularExpression/
Example
Explanation
sku = /^WM[0-9]+/
Evaluates to true if the sku variable has a value that starts with “WM” and is followed by one or more digits (WM001, WM95157)
Variable
variableName–OR–%variableName%
Variable name. For information about how to use this syntax to address children of other variables or elements of array variables, see Addressing Variables.
Example
Explanation
price
Value of the price variable
%address/postalCode%
Value of the postalCode variable in the address document
%poItems[0]%
Value of the first element in the poItems list.
String
"string"–OR–'string'
Literal string. Use this value type to compare the value of a variable to a string.
Example
Explanation
“Favorite Customer”
Value is the literal string “Favorite Customer”
‘Favorite Customer’
Value is the literal string “Favorite Customer”
Note:
Strings not enclosed in quotes (' or ") are interpreted as variable names.
Number
number
Number. The following examples indicate the accepted number formats:
Example
Explanation
-10, 5, 100
Integers
5.0, 6.02
Floating point number (java.lang.Double)
6.345e+4
Scientific notation
Null
$null
Variable is null or missing. Typically compared with a variable name to determine if the variable is null or missing from the input data.
Example
Explanation
%quantity% = $null
Evaluates to true if the quantity variable is missing from the input data or is null