Skip to main content
Version: 7.0

Built-in classes

Built-in classes are classes whose instances are objects belonging to primitive data types such as integers, strings, etc.

Class nameDescriptionlsFusion literals
INTEGER32-bit integer5, 23, 1000000000
LONG64-bit integer5l, 23L, 10000000000000L
DOUBLE64-bit floating point number5.0d, 2.35D
NUMERIC, NUMERIC[ , ]Number with fixed width and precision5.0, 2.35
BOOLEANLogical data typeTRUE, NULL
TBOOLEANLogical data type with a separate false valueTTRUE, TFALSE, NULL
DATEDate1982_07_13
DATETIME, DATETIME[ ]Date and time, optionally with fractional-seconds precision (0 to 6)1982_07_13_18:00, 1982_07_13_18:00:00
ZDATETIME, ZDATETIME[ ]Date and time with time zone, optionally with fractional-seconds precision (0 to 6)
TIME, TIME[ ]Time, optionally with fractional-seconds precision (0 to 6)18:00, 18:00:00
YEARYear
INTERVAL[DATE], INTERVAL[DATETIME], INTERVAL[TIME], INTERVAL[ZDATETIME]Interval — a pair of boundary values (from / to) of the corresponding date / time class
STRING, STRING[ ]String data type with optional maximum length, case-sensitive'text', 'text with\nbreak'
ISTRING, ISTRING[ ]String data type with optional maximum length, case-insensitive
BPSTRING, BPSTRING[ ]String data type with optional maximum length, case-sensitive, stored in the database as a fixed-length string
BPISTRING, BPISTRING[ ]String data type with optional maximum length, case-insensitive, stored in the database as a fixed-length string
TEXTString data type of arbitrary length, case-insensitive
RICHTEXTString data type of arbitrary length with formatting, case-insensitive
HTMLTEXTString data type of arbitrary length with HTML markup, case-insensitive
COLORColor#00ccff, #AA55CC, RGB(0, 255, 0)
JSONJSON in normalized form (key order, duplicate keys and formatting are not preserved)
JSONTEXTJSON stored as a text string as is
XMLXML
HTMLHTML markup stored as a string
TSVECTORFull-text search vector
TSQUERYFull-text search query
FILEFile of dynamic type (file content together with extension)
NAMEDFILEFile of dynamic type (file content together with name and extension)
RAWFILE, WORDFILE, IMAGEFILE, PDFFILE, VIDEOFILE, DBFFILE, EXCELFILE, CSVFILE, TEXTFILE, HTMLFILE, JSONFILE, XMLFILE, TABLEFILEFiles of specific type (RAWFILE: file with no extension or with unknown extension)
LINKLink to a file (URI)
RAWLINK, WORDLINK, IMAGELINK, PDFLINK, VIDEOLINK, DBFLINK, EXCELLINK, CSVLINK, TEXTLINK, HTMLLINK, JSONLINK, XMLLINK, TABLELINKLink to a file of a specific type (RAWLINK: link to a file with no extension or an unknown extension)

Inheritance

The built-in classes can be divided into seven class families (assuming that each of the remaining classes forms its own class family)

Class familyClasses
NumbersINTEGER, LONG, DOUBLE, NUMERIC, NUMERIC[ , ], YEAR
StringsSTRING, STRING[ ], ISTRING, ISTRING[ ], BPSTRING, BPSTRING[ ], BPISTRING, BPISTRING[ ], TEXT, RICHTEXT, HTMLTEXT
Date and timeDATETIME, DATETIME[ ]
TimeTIME, TIME[ ]
Date and time with time zoneZDATETIME, ZDATETIME[ ]
Files of a specific typeRAWFILE, WORDFILE, IMAGEFILE, PDFFILE, VIDEOFILE, DBFFILE, EXCELFILE, CSVFILE, TEXTFILE, HTMLFILE, JSONFILE, XMLFILE, TABLEFILE
Links to files of a specific typeRAWLINK, WORDLINK, IMAGELINK, PDFLINK, VIDEOLINK, DBFLINK, EXCELLINK, CSVLINK, TEXTLINK, HTMLLINK, JSONLINK, XMLLINK, TABLELINK

The built-in classes inherit only from one another within a single family, and cannot inherit from or be inherited by user classes. Inheritance within each family works on the principle that the narrower class inherits from the broader one. Where the classes of a family differ in several characteristics at once (blank padding, case insensitivity and maximum length for strings, the integer part and the precision for numbers), a class inherits from another one only when it is not wider in any of them; classes that are wider in one characteristic and narrower in another do not inherit from one another, and their common ancestor is a third class of the same family. In the DATETIME, TIME and ZDATETIME families the fractional-seconds precision is not such a characteristic: any class of such a family inherits from any other class of the same family.

A class that forms its own family is incompatible with the classes of other families and has no common ancestor with them. In particular, the HTML class (unlike HTMLTEXT, which belongs to the string family) is incompatible with the string classes: a selection with branches of the HTML and STRING classes has no common ancestor, so such a property cannot take any values, and the server reports the property '...' is always NULL error at startup. Adding (+) an HTML class value to a string is not an error, but returns a plain string: the result loses the HTML class, and the markup is escaped when displayed.

Common ancestor

According to this inheritance mechanism, the common ancestor of two built-in classes (e.g. for the selection operation) is determined as follows. If there are more than two classes, they are combined pairwise, one after another. In the rules below the two classes being combined are written in the order in which the platform combines them; that order matters only where each of the two classes inherits from the other, and in such cases the result is one of the two classes and is not determined by the pair of classes itself.

Strings

IF s1 is TEXT, RICHTEXT or HTMLTEXT
result = s1
ELSE IF s2 is TEXT, RICHTEXT or HTMLTEXT
result = s2
ELSE
result = STRING[blankPadded = s1.blankPadded OR s2.blankPadded,
caseInsensitive = s1.caseInsensitive OR s2.caseInsensitive,
length = MAX(s1.length, s2.length)]

where blankPadded, caseInsensitive and length are in turn determined as:

Class nameblankPaddedcaseInsensitivelength
STRING[n]falsefalsen
ISTRING[n]falsetruen
BPSTRING[n]truefalsen
BPISTRING[n]truetruen

A class name written without a length means unlimited length, which is greater than any n; if the resulting length is unlimited, the result is the class written without a length (STRING, ISTRING, BPSTRING, BPISTRING).

TEXT, RICHTEXT and HTMLTEXT are not blank-padded, are case-insensitive and have unlimited length, and the blank padding, case sensitivity and maximum length of the other class are not taken into account: the common ancestor of BPSTRING[10] and TEXT is TEXT, which is not blank-padded. The order of the two classes matters only when both of them are among TEXT, RICHTEXT and HTMLTEXT: these three inherit from one another in both directions, so the result is the first of the two, and such a combination should be avoided.

Numbers

IF p1.integerPart >= p2.integerPart AND p1.precision >= p2.precision
result = p1
ELSE IF p1.integerPart <= p2.integerPart AND p1.precision <= p2.precision
result = p2
ELSE IF p1.integerPart > p2.integerPart
result = NUMERIC[p1.integerPart+p2.precision, p2.precision]
ELSE
result = NUMERIC[p2.integerPart+p1.precision, p1.precision]

where integerPart and precision, in turn, are determined as:

Class nameintegerPartprecision
INTEGER100
YEAR100
DOUBLE9999999999
LONG200
NUMERIC[l,p]l - pp
NUMERIC9532

INTEGER and YEAR have the same integer part and precision, so each of them inherits from the other and the result is the first of the two.

In any NUMERIC class the total length (integerPart + precision) cannot exceed 127, and the precision cannot exceed 32; if the formula gives a larger total length, it is truncated to 127, which reduces the integer part of the result.

Files of a specific type

IF p1 = p2
result = p1
ELSE
result = RAWFILE
IF p1 = p2
result = p1
ELSE
result = RAWLINK

FILE, NAMEDFILE and LINK belong to none of these families: they are not broader classes for files and links of a specific type and have no common ancestor with them, or with each other. Two built-in classes without a common ancestor cannot be the possible results of one property — of a selection or an extremum, for example; a value of one of them is obtained from the other only by type conversion, written by the developer or applied by the platform itself, as when a file of a specific type is converted to a FILE or a NAMEDFILE and receives an extension.

Default value

It is sometimes necessary to use some value for a built-in class which will differ from NULL. Let's call this value the default value. It is used:

  • with data import - in the import condition, and in the columns for which NULL values are replaced
  • with form import - in the filters of the imported form
  • in the automatic resolution of simple constraints
  • when an object is added on a form to which filters are applied

The default value is defined as follows:

Class nameDefault value
Numerical classes0
Strings'' (empty string)
HTML, LINK, links to files of a specific type'' (empty string)
DATE, TIME, DATETIME, ZDATETIMEThe current date / time / date and time / date and time with time zone
YEARThe current year
Interval classesAn interval from the current moment to the current moment
BOOLEANTRUE (the only value of this class other than NULL)
TBOOLEANTTRUE
COLORWhite
JSON, JSONTEXT{}
Files of a specific typeEmpty file
FILEEmpty file with empty extension
NAMEDFILEEmpty file with empty name and extension
XML, TSVECTOR, TSQUERYNone

Extensions of specific type files

When files of a specific type (JSONFILE, XMLFILE, ...) are cast into a file of dynamic type (FILE, NAMEDFILE), whether explicitly or implicitly (e.g. with data import without specifying a format or when working with external systems), the extension of the result file is determined as follows:

Class nameExtension
RAWFILEThe empty string
JSONFILEjson
XMLFILExml
CSVFILEcsv
TEXTFILEtxt
WORDFILEdoc
EXCELFILExls
HTMLFILEhtml
PDFFILEpdf
VIDEOFILEmp4
DBFFILEdbf
IMAGEFILEjpg
TABLEFILEtable

For WORDFILE, EXCELFILE and IMAGEFILE, the extension additionally depends on the content of the file:

Class nameExtension
WORDFILEdocx, if the file is in the Office Open XML format
EXCELFILExlsx, if the file is in the Office Open XML format
IMAGEFILEpng / bmp, if the file is in the PNG / BMP format

The content is taken into account only when the file value itself is passed on - shown to the user on a form, sent to an external system, or attached to an email message. When a file of a specific type is converted to a file of dynamic type by a property, and also when the content does not match the formats listed above, the extension from the first table is used.

Values of classes other than files of a specific type can also be cast into a file of dynamic type; in this case the extension is determined as follows:

Class nameExtension
HTMLhtml
XMLxml
JSON, JSONTEXTjson
Strings, LINK, links to files of a specific typeThe empty string

Result properties

The platform declares one result property for each built-in class - a property without parameters that holds a value of that class. An action called from an external system passes its result to the response through them: unless the request names the properties to return, or the action has a result of its own, the response contains the value of the first property in the list below that is not NULL; the list is read from top to bottom. If the values of all these properties are NULL, the response is empty.

Class nameProperty name
FILEexportFile[]
RAWFILEexportRawFile[]
WORDFILEexportWordFile[]
IMAGEFILEexportImageFile[]
PDFFILEexportPdfFile[]
VIDEOFILEexportVideoFile[]
DBFFILEexportDbfFile[]
EXCELFILEexportExcelFile[]
TEXTFILEexportTextFile[]
CSVFILEexportCsvFile[]
HTMLFILEexportHtmlFile[]
JSONFILEexportJsonFile[]
XMLFILEexportXmlFile[]
TABLEFILEexportTableFile[]
NAMEDFILEexportNamedFile[]
TEXTexportText[]
RICHTEXTexportRichText[]
HTMLTEXTexportHTMLText[]
STRINGexportString[]
BPSTRINGexportBpString[]
NUMERICexportNumeric[]
LONGexportLong[]
INTEGERexportInteger[]
DOUBLEexportDouble[]
DATETIMEexportDateTime[]
ZDATETIMEexportZDateTime[]
INTERVAL[DATE]exportIntervalDate[]
INTERVAL[DATETIME]exportIntervalDateTime[]
INTERVAL[TIME]exportIntervalTime[]
INTERVAL[ZDATETIME]exportIntervalZDateTime[]
DATEexportDate[]
TIMEexportTime[]
YEARexportYear[]
LINKexportLink[]
RAWLINKexportRawLink[]
WORDLINKexportWordLink[]
IMAGELINKexportImageLink[]
PDFLINKexportPdfLink[]
VIDEOLINKexportVideoLink[]
DBFLINKexportDbfLink[]
EXCELLINKexportExcelLink[]
TEXTLINKexportTextLink[]
CSVLINKexportCsvLink[]
HTMLLINKexportHtmlLink[]
JSONLINKexportJsonLink[]
XMLLINKexportXmlLink[]
TABLELINKexportTableLink[]
BOOLEANexportBoolean[]
TBOOLEANexportTBoolean[]
COLORexportColor[]
JSONexportJSON[]
JSONTEXTexportJSONText[]
XMLexportXML[]
User classesexportObject[]
TSVECTORexportTSVectorLink[]

Language

A built-in class is written in code as a class ID - the keyword that names the class. Values of built-in classes are written as literals, each with its own form and constraints.