The main function of operations in the HubCloud service is to register an event in the company’s business activities and decompose this primary information into Register for storage and subsequent processing.
An operation can write to any number of Registers. Setting up the formation of entries in the Registers is carried out on the tab Records of the operation template.
To configure entries in a specific Register, click the Add Register button on the Records tab of the operation template. After clicking the button, the Register selection form will appear. In this form, you need to select the Register in which we plan to configure entries. After selecting a Register, a table with settings for records in the selected Register will appear on the Records tab.
To add entries to the Register, you must click the “+” button above the table with the Register settings. A new row will be added to the table with the Register settings.
In a new line, you must select the direction of the entries “+” or “-“. If the direction “-” is selected, data with a negative sign will be written into the numerical columns.
Then you need to select Source to create records.
Source of the records
A source for creating records can be:
- Record Source – the data source to the Operation Table, configured on the Record Sources tab.
In the case when the Header is selected as the Source, one record will be generated corresponding to this settings line. Only fields in the Operation header field will be available for filling in the Register fields.
In the case when the Table is selected as the Source, as many records as lines in the Operation Table will be generated for this settings line. To fill in the Register fields, both the Operation header fields and the fields of the table row will be available.
Also, entries in the Register can be formed by the Record Source – a special Data Source written to convert the Operation Table. The functionality of Record Sources is limited compared to regular Data Sources. The following functions are available in Record Sources:
Record Source should be used in those cases when, before writing to the Register, it is necessary to perform transformations of the Operation table, for example, perform grouping, some calculations.
Record Source Expression Example:
Table | GroupBy (Store, Product, Quantity)
Configuring Register column filling
After selecting the Source in the settings line of Register entries, you must specify which operation fields will be used to fill in the record fields of this Register.
To fill the record fields, both the Header fields and the Table fields can be used (if the source is a Table or Record Source). If we use the Header field, we specify the field in the format $h.name (h – mean Header). To indicate the field of the Table row we use an expression of the form $r.name (r – mean Row).
For example, $h.department is the Department field from the Operation header, $r.product is the product field from the line of the Operation Table.
Updating the structure of the Register entry settings table
Sometimes the structure of the Register in the settings model can change due to the fact that the conditions change, new requirements come to light, etc. Especially often, changes in the structure of Register occur at the stage of setting up the model.
In case the structure of the Register has changed, i.e. columns were added or deleted in the Register; it is necessary to update the settings for generating records in the operation templates. To do this, simply click the Refresh button located above the settings table. As a result, the columns of the record settings table will be updated. After that, it is necessary to write down the operation template.