Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 8 Using Expressions and Operators : Operators to Combine Expressions

Operators to Combine Expressions
An expression can be combined with one or more other expressions. The rules language supports the use of arithmetic operators and the concatenation operator (||) to combine expressions.
Arithmetic Operators
The rules language contains the following operators for doing arithmetic:
The arithmetic operators allow four types of operands: count, quantity, date, and typeless. The only operands allowed for unary - and unary + are count, quantity, and typeless. For a complete description of arithmetic operators and their behavior, refer to What are the Arithmetic Operators?.
Concatenation Operator
The rules language uses a double vertical bar (||) as the concatenation operator. Concatenation is valid between any two semantic data types and always has a result with semantic type string. For its syntax, the result follows these rules in order:
1.
2.
3.
4.
5.
Operators Within Expressions
Operators within an expression conform to conventional notation and obey the precedence that follows. Exponentiation has highest precedence and addition, subtraction, and string-concatenation have the same lowest precedence. In cases where more than one operator has the same precedence, such as addition and string-concatenation, the operators are evaluated strictly from left to right, unless explicitly overridden using parentheses.
Examples
Some examples of operators within expressions are:
CARS.PRICES = (PRICES.BASE + PRICES.SHIPPING) * TAXES.RETAIL
AMOUNT = PRINCIPAL * (1 + INTEREST) ** YEARS
You must use parentheses if you intend to do two or more exponentiation operations consecutively. Two correct examples are:
(A ** B) ** C
A ** (B ** C)

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved