Logical expressions
You can use the following operators in logical expressions:
- && or and for "and"
- || or or for "or"
- ! or not for "not"
Information noteNote: and and or are only supported
in Talend Cloud Pipeline Designer and Talend Data Mapper.
The operators && and || can be used between literal values, identifiers, functions or expressions. If an expression can be interpreted as an assignment expression, it should be in parentheses. For example, string1 = "Hello " && string2 = "World!" is interpreted as an assignment expression for the identifier string1. A valid logical expression would be either (string1 = "Hello ") && (string2 = "World!") or string1 == "Hello " && string2 == "World!".
The operators ! and not can be followed directly by a literal value, an identifier or a function, or by an expression in parentheses.
The following examples are valid logical
expressions:
customer.status.defined && customer.status.enabled
customer.birthday.defined || customer.age.defined
itemId == 1 and itemQuantity > 0
itemQuantity < 10 or itemPrice < 5
!customer.credentials.activated
!contains(customer.name, 'Dr')
!(customer.id == order.cust_id)
not(customer.id == order.cust_id)