Operators

Just as a sentence means nothing without a verb, anything you write in RuLa means nothing without operators. They make it possible for a variable to be defined, for a condition to work and for a rule to make sense.

The table below lists all available operators in alphabetical order, with a brief description. For a more extensive description of each individual operator, plus examples, click on it or visit the sub-pages in the menu on the left.

Available Operators and Keywords

Operator

Category

Description

=

Boolean

Compares. Evaluates to either true or false, delivering different outcomes.

!=

Boolean

Compares, true for 'is not equal to'.

>

Boolean

Compares, true for 'greater than'.

>=

Boolean

Compares, true for 'equal to or greater than'.

<

Boolean

Compares, true for 'less than'.

<=

Boolean

Compares, true for 'equal to or less than'.

:=

Special

Assignment, which can have any kind of expression on the right side of the operator.

+, -, /, *, %

Mathematical

Perform basic mathematical calculations.

[ , ]

List

Creates a new list from single values, allowing other list operators to perform actions on the new list.

ADD_YEARS

Date

Takes a date and adds a specified number of years to it.

AFTER

Date

Takes two dates, and checks if the first one comes after the second one.

AFTER_EQUAL

Date

Takes two dates, and checks if the first one comes after, or is the same as, the second one.

ALL

List

Evaluates if all values in a list are true.

and

Boolean

Sets as condition that both expressions have to be true to have the entire expression evaluate to 'true'.

and then

Boolean

Similar as above, but when using 'and then', the second question is only asked when the first evaluates to 'true'.

AVG

Mathematical

Calculates the average value.

AVG_OF_ANY

Known

Calculates the average of available values.

BEFORE

Date

Takes two dates, and checks if the first one comes before the second one.

BEFORE_EQUAL

Date

Takes two dates, and checks if the first one comes before, or is the same as, the second one.

calculated_name

String

Accesses the calculated name of an instance.

CEIL

Mathematical

Returns the value of the given parameter, rounded up to a whole number.

CONCAT

String

Combines two values into one new value, specifying what should separate the two.

contains

List

Goes over a list, which is given on the left of the operator. Evaluates to 'true' if the single value on the right is present in the given list.

contains all

List

Expressions with this operator will only evaluate to 'true' if all values from the list on the right side are present in the list on the left side.

contains any

List

Going over a list, given on the left side of the operator, this operator has the expression evaluate to true if any value from that list is present in a list or the single value given on the right side.

COUNT

List

Returns the number of occurrences of the given parameter.

ensure

Special

Makes sure a case contains at least, for example, 1 Person. (replaces create)

FIRST_ELEMENT

List

Returns the first element from a list.

FLOOR

Mathematical

Returns the value of the given parameter, rounded down to a whole number.

get_attr

Special

Gives access to named properties of an instance using expressions.

get_properties

Special

Returns specific information on an instance's properties.

in

List

Checks if a value is present in a taxonomy.

instances

Special

Returns all instances of the given type(s) living on the platform.

is

Special

Basic assignment of a variable.

JOIN

String

Combines a list of values into one new value by appending them.

known

Known

Sets a condition for when a property is not unknown.

LIST_OF_ANY

Known

Builds a list of only the values that are available out of all the values it is given.

MAP

List

Performs the same action on each individual value in a list.

MAX

Mathematical

Returns the highest value.

MAX_OF_ANY

Known

Returns the highest out of available values.

MIN

Mathematical

Returns the lowest value.

MIN_OF_ANY

Known

Returns the lowest out of available values.

not

Boolean

A negation.

not in

List

Evaluates to true if the given value is absent from the specified taxonomy.

NOW

Date

Current date and time.

ontology

Special

Sets a condition based on the type of ontology.

optional

Special

The rule can accept, but will not require, for example, a third person.

or

Boolean

When just one of the two given expressions is true, the entire expression evaluates to 'true'.

or else

Boolean

Similar to above, but the second question is only asked if the first has been answered.

roles

Special

Sets a condition based on role(s).

ROUND

Mathematical

Returns the value of the given parameter, rounded to a whole number.

self

Special

Refers to the current instance where you use it.

SNEAKY

Known

Wrapping an expression with SNEAKYhas the system ignore the expression, if the information used in it is not available.

SOME

List

Evaluates if any value in a list is true.

SUBTRACT_YEARS

Date

Takes a date and subtracts a specified number of years to it.

SUM

Mathematical

Adds up numbers.

SUM_OF_ANY

Known

Adds available numbers.

SUM_PRODUCT

Mathematical

Multiplies values in one list with values on the same index in another list. Returns the sum of the multiplications.

UNION

List

Combines the elements of two sets into one single set.

UNION_OF_ANY

Known

Creates a combined list of the available values and lists out of all values and lists you provide.

unknown

Known

Sets a condition for when a property is unknown.

YEARS_AGO

Date

Calculates the number of years since a given date.