Reference: |
You can add customized rules as required by your site. All BRL keywords must be written in uppercase.
The following table lists and describes the BRL keywords for variable declarations.
Keyword |
Description |
---|---|
ATTRIBUTE |
Declares the type of a variable to be an attribute-value pair. Each pair is treated as a simple Boolean. There are two types of attributes: single-valued (only one attribute-value pair can be true at any moment) and multiple-valued (one, some, or all the attribute-value pairs can be true simultaneously). The default is single-valued. (See MULTI below). |
MULTI |
Defines an ATTRIBUTE as possibly having multiple values. |
NUMERIC |
Declares the type of a variable to be numeric. |
SIMPLEFACT |
Declares the type of a variable to be logical; that is, true or false. |
STRING |
Declares the type of a variable to be a character string. |
The following table lists and describes the BRL keywords for rule declarations.
Keyword |
Description |
---|---|
ACTIVATE |
Allows execution of external routines or pre-defined internal functions. See Internal Functions for a list of executable ACTIVATE routines. |
AND |
Serves as a logical operator for joining variables or a sequencing operator when it connects a series of actions or statements. In premises containing both AND and OR, statements are evaluated from the top to the bottom of the rule, in order of appearance. |
ARE |
The keywords IS, ARE, and the symbol \ can be used interchangeably. (See the keyword IS.) |
DATA |
When used with READ, causes a variable to be assigned a value that is read from memory in the server. In conjunction with WRITE, DATA causes the value of a fact to be written to memory in the server. The purpose of DATA is to transfer the value of a variable between a rule file and the server or functions invoked through the ACTIVATE keyword. Each DATA keyword must be on its own line in the rule file. The value of a variable read in by DATA goes into the session context and is useable from then on. |
END |
Marks the end of a rule file and signals the termination of the text of BRL. Omitting END will result in a compiler error. |
IF |
Introduces the premise of a rule. There can only be one IF per rule. Multiple premises can be tested and joined by AND or OR. |
INIT |
Enters values into the session context when a rule file is first executed. The purpose of INIT is to assign values needed when processing begins. Variables initialized with INIT are available before any rules execute. |
IS |
Binds an ATTRIBUTE variable to a value. In the premise of a rule, the IS value is interpreted as a test to determine whether the attribute-value pair is a true statement. In a conclusion, the IS value assigns a value of true to the statement. The keywords IS, ARE, and the symbol \ can be used interchangeably. |
NOT |
Negates the true value of a variable. In the premise of a rule, a statement beginning with NOT is true if the variable following NOT is false and vice versa. In the conclusion of a rule, NOT enters the following variable into the session with the value false if the rule executes. |
OR |
The logical operator for connecting variables in the premise of a rule. OR makes it possible to combine rules having the same conclusion into a single rule. In premises containing both AND and OR, statements are evaluated from the top to the bottom of the rule, in order of appearance. |
READ |
Causes values from the following DATA keywords to be assigned to the variables listed with DATA. |
RULE |
Specifies the name of a BRL rule. Every rule must begin with the reserved word RULE followed by the name of the rule. Rule names do not have to be distinct. All rules must contain the keyword THEN followed by a variable that is a SIMPLEFACT or ATTRIBUTE. |
THEN |
Introduces the primary conclusion of a rule. Every rule must have the keyword THEN. All the BRL statements in the primary conclusion are executed when the premise of the rule is true. The first statement following THEN must be a SIMPLEFACT type of variable. Numeric, string, and procedural statements are not permitted immediately following THEN although they are allowed elsewhere in the conclusion. The primary goal that the rule engine tries to solve is DBA Rules Concluded. However, any alternate SIMPLEFACT may be used if subsequent rules test for the alternate and solve for the DBA Rules Concluded. This forces back-chaining and all the rules to be evaluated. |
WHAT |
Used with IS, ARE, or the symbol \ and the keyword DATA to indicate that multiple values are to be returned or sent for an ATTRIBUTE (as in DATA attribute IS WHAT). |
! or ? |
The comment operator marks the beginning of a comment in a BRL source file. |
" " |
Quotation marks designate a string literal. Literals must be enclosed in double quotation marks to permit the use of reserved BRL symbols and words and leading and trailing blanks when assigning a value to a variable, and to differentiate a literal value for a variable from a variable name. |
:= |
The assignment operator assigns the value on the right side of the := symbol to the variable on the left side (this operator is used with NUMERIC and STRING variables). |
\ |
The keywords IS, ARE, and the symbol \ can be used interchangeably. (See the keyword IS.) |
Arithmetic Operators |
Used in performing calculations involving numeric expressions. ( )- Parenthesis. * - Multiplication. / - Division. + - Addition. - - Subtraction. |
Relational Operators |
Relational operators are not allowed in conclusions of rules. Strings or numerics can be compared. = - Equal to. < > - Not equal to. < - Less than. > - Greater than. <= - Less than or equal to. >= - Greater than or equal to. |
WebFOCUS |