Accessing Data Records and Fields

This section describes the way how the record fields should be worked with. As you know, each component may have ports. Both input and output ports are numbered starting from 0.

Metadata of connected edges may be identified by names or IDs.

Metadata consist of fields.

Working with Records and Variables

Now we suppose that ID of metadata of an edge connected to the first port (port 0) - independently of whether it is input or output - is Customers, their name is customers, and their third field (field 2) is firstname.

Following expressions represent the value of the third field (field 2) of the specified metadata:

For input data following syntax can also be used:

Integer variables can also be used for identifying field numbers of input records. When an integer variable is declared (int index;), following is possible:

This way you can also create loops. For example, to print out field values on the first input port you can type:

int i;
for (i=0; i<length(@0); i++){
     print_err(@0[i]);
}

You can also define records in CTL code. Such defitions can look like these:

Records from an input edge can be assigned to records declared in CTL in the following way:

Mapping of records to variables looks like this:

Mapping of variables to records can look like this: