Special Functions
Special Functions
| Function | Description | |
|---|---|---|
| copy(object) | Copies an object for independent modification from the original object. This functionality is implemented to support variations from rules. |
|
| error(String “msg”) | Displays the error message. | |
| error(String code, String message) | Returns a custom error with custom error code, both defined as arguments, in the HTTP response, OpenL Studio UI, and in the logs. |
|
| fieldname(object) | Returns a value from the specified field of the object age(driver) is the same as driver.age; age(drivers) returns the ages list of all drivers. |
|
| format(pattern, parameters) | Returns values according to the specified pattern. Example: format(“The user {1} has policy number {0}”,”P2289818293”,”Alex”) returns “The user Alex has policy number P2289818293”. |
|
| getValues(MyVocabularyDatatype) | Returns an array of values from the MyVocabularyDatatype vocabulary data type. Returns MyVocabularyDatatype[] . |
|
| instanceOf(Object, className.class) | Returns a Boolean value defining if the Object is of the specified class. This function is deprecated. | |
| msg(String code, Object… params) | Reads the localization message bundles in the i18n format. For more information on localization, see Project Localization. |
|
| new Datatype(value of attribute1, value of attribute2) or Datatype(value of attribute1, value of attribute2) or Datatype(attribute1 = value of attribute1, attribute2 = value of attribute2) or new Datatype(attribute1 = value of attribute1, attribute2 = value of attribute2) |
Used to create an instance of the datatype. Values must be comma-separated and listed in the same order in which the appropriate fields are defined in the datatype. The word new can be omitted. Alternatively, a form with parameter enumeration can be used. Parameters can be listed in any order and it is not required to specify all the parameters. Note: When there is a datatype and method, DT or Spr, with the same name and number of parameters, method call and constructor call with the omitted “new” keyword have exactly the same syntax. In this case, the method call is selected. Examples: ** new Person("John", "Smith", 24) or Person("John", "Smith", 24) or Person(firstname= "John") or new Person(firstname= "John") or Person() |
|
| new Datatype[] {} | Used to create a data array. The number in the square brackets [] denotes the size of the array, for example, new String[10]. If no number is provided, an empty array is created, for example, new String[]. Values in the braces {} define the values of the appropriate array elements. Example: new Integer[]{1,8,12} |
|
| toString(value) | Converts value to the string. |