Overview of Using Constraint Definition Language

You use the Constraint Definition Language (CDL) to create your statement rules, and you use the CDL editor in the Configurator Models work area to edit your CDL code.

Here are just some of the keywords, operators, and functions that you can insert into your code.

Here are just some of the keywords, operators, and functions that you can insert into your code.

You can specify these relationships:

  • Logical
  • Numeric
  • Compatibility
  • Comparison

Each rule contains:

  • Rule Definition
  • Rule Statements
  • Data Types

Rule Definition

Each statement rule has a name, rule text, and other attributes, such as the rule's class.

Rule Statement

Each rule statement specifies the rule's intent, such as:

If the user selects option a, then add a value of 10 to the x integer feature

Note

  • You use the semicolon (;) to separate each statement.
  • You can use an explicit statement and an iterator statement.
  • Oracle Configurator parses each rule statement as a token. Everything in CDL is a token, except white space characters and comments.
  • Each statement includes one or more clauses.
  • Each clause includes keywords and one or more expressions.
  • A keyword is a predefined token that determines the CDL format. CONSTRAIN, COMPATIBLE, REQUIRES, IMPLIES, LIKE, and NOT are each an example of a keyword.
  • An expression contains the operator and the operands.
  • An operator is a predefined keyword, function, or character that involves the operands in each logical, functional, or mathematical operation. REQUIRES and the plus sign (+) are each an example of an operator.
  • An operand can be an expression, a literal, or an identifier. The literal or identifier can be a singleton or a collection.
  • Each node that you reference in a statement is a participant.
  • A literal is a token that contains a specific type of data, such as Numeric, Boolean (True or False), or Text. The literal in CDL is similar to the constants that you use in other programming languages.
  • An identifier identifies a node or attribute in your model. It uses a sequence of letters and digits that starts with a letter.
  • An identifier can also identify a parameter. You can use it in an iterator statement. You use an ampersand (&) to prefix the name of each parameter.
  • CDL uses separators to help you scan and read your code. CDL also uses separators to establish boundaries between tokens and to group them to help maintain the code's structure. Each separator is a single character, such as the semicolon between statements or the parentheses that enclose an expression.