CDL Operators

An operator is a predefined token that consists of Unicode characters. You use it to specify the operation to perform at run time between operands.

Operators That You Can Use

Operator Type Operator Description
Logical AND
  • Requires two operands.
  • If each operand is true, then it returns true.
Logical OR
  • Requires two operands.
  • If either operand is true, then it returns true.
Logical NOT
  • Requires one operand.
  • If the operand is true, then it returns false.
  • If the operand is false, then it returns true.
Logical REQUIRES
  • Requires two operands.
Logical IMPLIES
  • Requires two operands,
Logical EXCLUDES
  • Requires two operands.
Logical NEGATES
  • Requires two operands.
Logical and Comparison LIKE
  • Requires two text literal operands.
  • If the values in each operand match each other, then it returns true. If not, it returns false.
Logical and Comparison NOT LIKE
  • Requires two text literal operands.
  • If the values in each operand don't match each other, then it returns true. If not, it returns false.
Logical, Arithmetic, and Comparison =
  • Requires two operands.
  • If the values in each operand match each other, then it returns true. If not, it returns false.
Logical, Arithmetic, and Comparison >
  • Requires two operands.
  • If the value in the first operand is greater than the value in the second operand, then it returns true. If not, it returns false.
Logical, Arithmetic, and Comparison <
  • Requires two operands.
  • If the value in the first operand is less than the value in the second operand, then it returns true. If not, it returns false.
Logical, Arithmetic, and Comparison <>
  • Requires two operands.
  • If the value in the first operand is equal to the value in the second operand, then it returns true. If not, it returns false.
Logical, Arithmetic, and Comparison <=
  • Requires two operands.
  • If the value in the first operand is less than or equal to the value in the second operand, then it returns true. If not, it returns false.
Logical, Arithmetic, and Comparison >=
  • Requires two operands.
  • If the value in the first operand is greater than or equal to the value in the second operand, then it returns true. If not, it returns false.
Arithmetic *
  • Performs multiplication on numeric operands.
Arithmetic /
  • Performs division on numeric operands.
Arithmetic -
  • Performs arithmetic subtraction on numeric operands.
Arithmetic +
  • Performs arithmetic addition on numeric operands.
Arithmetic ^
  • Performs arithmetic exponential on numeric operands.
Arithmetic %
  • Performs arithmetic modulo on numeric operands.
Text +
  • Concatenates text strings.
Other Assign(node)
  • Assigns a node to a point in a sequence.
  • If you specify the Domain Ordering attribute on the node's details page, then Oracle Configurator assigns the node. If you don't specify this attribute, then Configurator implicitly assigns the node according to the operator type.
  • You can use this operation only with a rule that's in the Default class or the Search Decision class.
Other IncMin()
  • Similar to the Assign(node) operator, but IncMin() overrides any explicit or implicit operations that assign the node and instead attempts to use a binary search with increasing minimum to assign the node.
  • You can use this operator with an integer or decimal, including items and options that have a quantity.
  • If you don't explicitly specify a system attribute, such as State, Quantity, or Value, then Configurator applies this operation to the node's default system attribute.
  • If you use this operation on an item, then you can specify the RelativeQuantity attribute as an alternative.
  • You can use this operation only with a rule that's in the Default class or the Search Decision class.
Other ( )
  • Groups an expression.
Other ,
  • Separates arguments.
Other .
  • References a part of a model.
Other -
  • Changes a positive value to a negative value or changes a negative value to a positive value.

Operator Data Types

Operator Data Type
Arithmetic

Integer

Decimal

Logical Boolean
Comparison Boolean

You can use the result of each operator as an operand of another operator. Each of these operators must use the same data type. For example:

  • If operator x is a decimal, and if operator y is a decimal, then you can use the results of x as an operand of y.
  • If operator x is a decimal, and if operator y isn't a decimal, then you can't use the results of x as an operand of y.

Operator Precedence

Configurator uses this precedence when it processes operators:

Precedence Operator Description
1 (right) () Parenthesis
2 (right) . Navigation
3 (right) ^ Arithmetic power
4 Unary +, - NOT Unary plus and minus, Not
5 (left) *, /, % Arithmetic multiplication and division
6 (left) Binary +, - Arithmetic plus and minus, text concatenation
7 (left) <, >, =, <=, >=, <> LIKE, NOT LIKE Comparison operators
8 (left) AND Logical AND
9 (left) OR Logical OR
10 (left) DEFAULTS, EXCLUDES, NEGATES, IMPLIES, REQUIRES Logic operators

If two or more operators have the same precedence, then Configurator processes them from left to right as they appear in the rule.

LIKE and NOT LIKE Operators

You can include the LIKE operator and the NOT LIKE operator to compare text.

  • You can use them only on static context. For example, you can use the WHERE clause of an iterator.
  • You can use LIKE or NOT LIKE with a run time participant only if the operator evaluates to a constant string. Configurator validates this condition when you save the model.

Use LIKE to Get a Boolean Value

Consider this example:

a.attr.Value() LIKE "%eig%"

Here’s how that works:

If the Text of a.attr Contains Then Configurator Returns
eig, such as a.attr =weight or eight true
Rein false

In this example, if the user selects option A and option B, and if the value of their attributes is A1B1, then the rule selects all options in C:

Constrain Alltrue('A','B') implies &C
for all &C in {optionsof('C')}
where &C.userAttrs["Selections.AB Compatibility"] like "A1B1"

If the user selects option A and option B, and if the value of their attributes isn't A1B1, then the rule selects all options in C:

Constrain Alltrue('A','B') implies &C
for all &C in {optionsof('C')}
where not (&C.userAttrs["Selections.AB Compatibility"] like "A1B1" )

Concatenate Text Operator

You can use the + (plus sign) to concatenate text.

  • You can use it only with static text. For example, you can use it in an iterator's WHERE clause.
  • You use it in the body of a constraint or contributor statement only if it evaluates to a constant string. Configurator validates this requirement when you save the model.

Collect Operator

You can use the Collect keyword to create a collection and then provide the collection to an operator that can use a collection as an argument. For example, instead of AnyTrue(x, y, z), you can write AnyTrue(COLLECT &c FOR ALL &c IN {x,y,z}).