Data Tables

Top  Previous  Next

A Data Table may contain zero or more records (lines) and zero or more fields (columns), and thus (records * columns) cells filled with data. The records (lines) for a given table are described by a Table Format. All records in a Data Table are always of the same format. The Table Format describes every field in the table and contains several other options.

Even the most simple variables, containing just a single string or number, are represented by a Data Table with just one record and one field. This may seem strange at first glance, but the concept of Data Tables significantly simplifies complex operations.

Uses of Data Tables

Data Tables are widely used in AggreGate. They have three primary uses:

Variable values. The value of each variable in every AggreGate Server context is represented by a Data Table. Its format is specified by a variable definition.
Function input and output values. Input and output values for each function in every AggreGate Server context is represented by a Data Table. Its format is specified by function definition.
Event data. Every AggreGate Server context event has a separate Data Table associated with it. This Data Table contains event-specific data. Its format is specified by event definition.

Table Format

The Table Format contains complete information about a table. It may exist independently from a Data Table. You can create several Data Tables using the same Table Format. When you add a new (empty) record to such a table, every field in it will initially contain a default value, as specified by the Table Format. If the field is defined as "nullable", the value can also be NULL (i.e, no value).

The table format is most commonly used in the following cases:

To define the format for a context variable,
To define the format for the input and output values of context functions,
To define the format for a Data Table associated with an event.

Table format defines the following table properties:

Property

Description

Minimal and maximal record count

The number of records should be within this range, otherwise the table will be treated as invalid.

Reorderable

This flag indicates that records in this table may be swapped (re-ordered) during table processing

Record Validators

Rules for validating every record in a table. These are used internally and are not user-configurable.

Table Validators

Rules for validating the whole table. These are used internally and are not user-configurable.

Bindings

A list of data bindings that define how the values in the table are changed when other table cells, or environment variables, are changed during table processing.

Naming Expression

An Expression that defines how the table is presented to the users in the interface.

Field Format

The Table Format consists of several Field Format descriptors describing each field. Most of these descriptors are never configured by the user (or administrator). They're internal settings, and are only covered here for reference.

Field properties:

Property

Description

Name

Field name.

Description

Textual field description.

Help

Detailed description of a field.

Default Value

Default value of the field. You can omit this only if the field is nullable (see below).

Nullable

Flag indicating that field can contain NULL ("Undefined") values.

Non-Replicatable

Flag that indicating that field should be skipped during Data Table Smart Copy operation.

Key Field

Flag designating field as a key field. Key fields force the Data Table Smart Copy operation to employ a special copy algorithm.

Selection Values

List of values that can be selected for the field, along with textual descriptions.

Extendable Selection Values

Flag indicating the field may be set to any value, including ones not listed in Selection Values.

Validators

List of validators used to check if value is suitable for the field. AggreGate Server features several pre-configured validators, internally used by the system to verify user input.

Editor/Renderer

This parameter defines how the field is shown and modified in the user interface.

Icon

String ID of field icon.

Group

Human-friendly field group description.

Field Types

There are several predefined field types that may appear in Data Tables:

Field Type

Desctiption

Integer field

Contains a 32-bit signed integer number.

Long field

Contains a 64-bit signed integer number. Long fields are often used to hold time periods expressed in milliseconds.

String field

Contains a string (unlimited length).

Boolean field

A "flag" field with two possible values: TRUE or FALSE.

Float field

Contains a 32-bit floating point number.

Double field

Contains a 64-bit floating point number. In most cases, Double should not be used in favor of Float.

Date field

Contains a millisecond-precision timestamp. It may be treated as date, time, or a timestamp (date + time).

Data Table field

Contains a nested Data Table.

Color field

Contains a color definition (RGBA).

Data Block field

Contains binary data that may be treated as a generic file, image, sound etc.