You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

boolean conditions are evaluated from left to the right. There is no order for the logical operators. Use parentheses to create hierarchy in your logical expressions. Example: TRUE OR (TRUE AND FALSE) will evaluate (TRUE AND FALSE) first.

AND

This function returns TRUE if all its arguments evaluate to TRUE; it returns FALSE if one or more arguments evaluate to FALSE.

Syntax

argument1 AND argument2 [AND ...]
  • argument1 - The first boolean condition that you want to evaluate.
  • argument2 - The first boolean condition that you want to evaluate.
  • [AND …] - Additional boolean conditions that you want to evaluate.

Return type

  • boolean

Examples

  • TRUE AND TRUE results in TRUE
  • TRUE AND FALSE results in FALSE
  • TRUE AND ? (= UNKNOWN) results in UNKNOWN

OR

This function returns TRUE if at least one of its arguments evaluates to TRUE; it returns FALSE if none of the arguments evaluate to TRUE.

Syntax

argument1 OR argument2 [OR ...]


argument1 - The first boolean condition that you want to evaluate. argument2 - The first boolean condition that you want to evaluate. [OR …] - Additional boolean conditions that you want to evaluate.

Return type

  • boolean

Examples

  • TRUE OR TRUE results in TRUE
  • TRUE OR FALSE results in TRUE
  • TRUE OR ? (= UNKNOWN) results in TRUE
  • FALSE OR ? (= UNKNOWN) results in FALSE (since none of the arguments is TRUE)

 

TRUE

This is the boolean value TRUE.

FALSE

This is the boolean value FALSE.

NOT

This operator reverses the value of its boolean argument.

Syntax

NOT argument
  • argument - The boolean condition of which you want to reverse its value.

Return type

  • boolean

Examples

  • NOT (TRUE) results in FALSE
  • NOT (TRUE AND FALSE) results in TRUE
  • NOT (? (= UNKNOWN)) results in UNKNOWN
  • NOT (NOT (TRUE)) results in TRUE

UNKNOWN

You can use the '?' (question mark), representing UNKNOWN, to check if an expression or an attribute has a value.

Example

Suppose a model with an entity Person and attributes Person.name and Person.age. In runtime, a user fills out a form and enters his name, but forgets to fill out his age.

As a result

  • Person.name = ? returns FALSE since this attribute is filled out
  • Person.age = ? returns TRUE since this attribute is not filled out and therefore is UNKNOWN
  • No labels