Rule Function Terms Overview

Rule functions terms are the heart of most rule definitions within an application. While there are situations where a rule may be defined to contain a single rule term that returns the value of a global or other such data definition type, most rules are more complex than this and consist of multiple function calls.

Most rule functions take one or more arguments, each of which contains a data value for the function. When the function is evaluated, these data values are processed in some manner. The result of this processing is a single return value that is passed to the function’s caller. A function will always provide the caller with a value in the data type the caller asks for. Not all function support all data types for their return values. If a data type is not one supported by the function, that function will return the null-equivalent of that data type.

There are over a hundred different functions available for a rule definition. These are organized into Function Categories. These categories denote the general types of behavior for the functions. The rule editor presents the functions to the developer organized into one of these categories.
  • Conversion Functions - Conversion functions set the context of a given term to a specified data type. A conversion function supports all return types within the rule definition. The names of conversion functions dictate what data type they will set for the context of a function call.
  • Logical Functions - Logical functions are those that provide the comparison and decision making functionality to a rule. This includes if-then-else and comparison operations and behaviors.
  • Mathematical Functions - Mathematical functions provide math operations to rules. This includes addition, subtraction, multiplication, division, and modulus operations, as well other mathematical functions, such as rounding, and working with significant digits.
  • Property Functions - Property functions are those that operate on properties, usually of a certain data type. Most property functions are provided for the intended purpose of working with a given type of property, such as an object collection or external data property.
  • String Functions - String functions provide behaviors for manipulating string values, including concatenation and parsing operations, string search and replacement, and other string-related operations.
  • System Functions - System functions are those that provide access to information about the Agentry Client’s host system, or information that is general to the client. This can be information such as the system’s time and date, or the user ID of the current user. This category also includes functions to access hardware components of the client device such as barcode scanners and GPS units.
  • Table Functions - The table functions provide access to the records of complex table and data tables stored on the Agentry Client.

Note that the function categories do not directly impact where a function can be used, or which rules can use a given function. The categories are an organizational aid built into the rule editor to aid the developer in locating the rule function that is needed.