Data models
Use this function to define a group of linked tables, either directly or through cascading relashionships, with (1,1) or (1,N) link types to a main table that is supposed to be online.
You can then use a data model:
- In a workflow rule:
- Because it features the only available context to describe the tables to be scanned, as in the case of a manual-type rule, where the model is mandatory.
- Or to enhance the triggering context (as in the case of other rule types).
- In an allocation rule, where the model is mandatory. It defines the group of tables containing the fields upon which the user allocation rule is based. The data model associated with a workflow rule and the data model associated with the allocation rule must be identical.
- In a ZPL report, to define the data extraction logic for printing thumbnails.
- In a setup model, to describe the setup data to extract or copy.
- In the description of the data to be indexed by a search engine.
-
As the first entry point to define GraphQL nodes, as the required base is a table or a set of tables with relationships. You can also define the collections and standalone references for these nodes.
Two sections in the left list filter data models related to nodes and node collections.
Prerequisites
Refer to the implementation documentation.
Screen management
The screen is defined in 3 tabs:
- The header,
- The Links tab,
- The Miscellaneous tab.
Header
This section outlines the key information for data models.
General information
Model code (MODELE) |
Enter the code identifying the current record. A standard data model created for an API node is named API_TABLENAME_#, where TABLENAME is the name of the main table, and # is a sequence number used when multiple data models are based on the same table. This field is mandatory. |
Description (ZINTIT) |
Enter a description for your data model. |
Active (ENAFLG) |
Select this checkbox to activate the current record. Disabled records keep their content and setup but cannot be used by recalling their code:
The authorizations for a given function can prohibit the creation of an active record. In this case, the checkbox is disabled by default. It can only be modified by an authorized user or through a signature workflow. |
Characteristics
Activity code (CODACT) |
An activity code is used to:
If the activity code is disabled:
|
Module (MODULE) |
Select a module for the setup. Use this field to specify if the screen has to be created in the folder database. This is the case when the module linked to the screen is active on the folder. |
Properties
Setup templates (FLGAPH) |
Select this checkbox if the data template is linked to the setup template. |
Workflow (FLGWRK) |
Select this checkbox if the data template is linked to a workflow. |
Deliverable definition (FLGADLV) |
Node (API) (FLGNODE) |
Select this checkbox if the data model is intended to be published as an API node. |
Links
The definition screen displays the entire tree structure of the tables to be processed, all of which are directly or indirectly linked to the main table. The grid lines indicate the successive joins to be performed in order to have the complete context available online.
Block number 1
Main table (TABREF) |
Select the main table from which other tables are read via direct links or cascading relationships. This table must be online if the model is used in a manual workflow rule. In a manual workflow, this table belongs to the join that is opened and processed during workflow execution. This field is mandatory. |
Node name (ANODNAM) |
Enter the name under which the data model is published as an API node. |
Package name (API) (APACKNAM) |
Select the API package to which the node belongs. |
Ref. Data model (API) (FLGREFAWM) |
Select this checkbox to define this API node as the reference for foreign keys. This allows you to define a unique API node as the reference. |
Grid
Linked table (TABLNK) |
Select the table linked to the origin table. |
Abbrev. (ABRLNK) |
Enter the abbreviation under which the linked table is opened. If this field is not populated, the table's default abbreviation is used. Providing an abbreviation is useful if the table appears multiple times in the grid, as it ensures that multiple linked rows from the same table are online simultaneously. |
Origin table (TABORI) |
This field identifies the main table at the origin of the link described on the current line. It can be the main table or one of the linked tables from the previous lines. |
Abbrev. (ABRORI) |
Enter the abbreviation under which the linked table is opened. If this field is not populated, the table's default abbreviation is used. Entering an abbreviation is useful if the table appears multiple times in the grid, as it ensures that multiple linked rows from the same table are online simultaneously. |
Key (CLELNK) |
This field defines the table key code used to read the linked rows. By default, the table's primary key is used. |
Type (TYPLNK) |
The type takes on one of the 4 following values:
|
Link expression (EXPLNK) |
Map the fields in the main table to the corresponding index in the linked table, as specified in the Key column. Enter one or more calculated expressions, separated by semicolons. Each expression is evaluated, and the result is used to determine the key value for performing the join. When multiple joins are authorized, only the first elements of the key can be specified. Expressions can include constants as well as fields from tables previously defined in the link list. |
Selection expression (EXPSEL) |
This selection formula is applied to the table defined in the Linked table column and is used to filter the data in the template These conditions are not applied during the indexing process. The syntax follows the Sage X3 script syntax of used in the Filter instructions.
|
Node name (ANODLNK) |
Enter name of the API node that represents the linked table. Node names must follow the PascalCase naming convention. |
Property name (API) (APROPLNK) |
Enter the name of the API property that represents the collection of nodes, or the reference when it's a standalone reference. API property names must follow the camelCase convention and include an s at the end if they represent collections (0,n or 1,n relationships). |
Package name (API) (APACKLNK) |
You can specify a different package for delivering this property or collection. Enter a package name for the collection property to be declared as a node extension within the specified package. If you leave this field empty, the property will be declared in the same package as the main node. |
Mutable reference or collection (AISMUTABLE) |
Select this checkbox to include the collection property in the payload of the node's mutations. If unselected, the collection property is not mutable and cannot be modified. The collection will be part of the node definition but excluded from the payload for mutations. |
Overwrite property (API) (APROPZONE) |
By default, a reference to another API node (foreign key) is determined by the Linked table field in the Tables function (GESATB). In most cases, the default table setup is sufficient to determine the reference properties in the API. However, there can be situations where the reference to the node needs to be adjusted. Fill in this field to override the default table definition and use the standalone reference, defined as a data model link, to replace the default foreign key. |
Activity code (CODACT ) |
An activity code is used to:
|
Miscellaneous
In this section, you can define the characteristics specific to the data model, based on its intended use.
Workflow
Company field (FLDCPY) |
Define the current company from the perspective of the workflow rule. This ensures that when the allocation rule is available by company, the appropriate rule is used based on the value of the field. |
Site field (FLDFCY) |
Define a current site, allowing the current company to be derived from it (if it is not already defined in the company field) from the workflow rule perspective. This ensures that when the allocation rule is available by company, the appropriate rule is selected based on the value of the field. |
Setup templates
Legislation field (FLDLEG) |
Filter the records related to a specific legislation during patch creation or integration carried out by the Setup copy function (ACOPAPH). |
Options grid
Option title (AZOPTLIB) |
Option code (OPTCOD) |
Option condition (OPTCND) |
Error message (AZOPTERR) |
Specific buttons
-
Copy
Select this button to copy the current record into another folder.
OBJET This fields indicates that you are copying a data model. CLES This field displays the code of the data model that is being copied. From folder (DOSORG) Select the folder from which the record is copied. The possible syntaxes are described in the dedicated appendix.
All folders (TOUDOS) Select this checkbox to copy the record to all the folders defined in the dictionary (ADOSSIER table of the current solution).
To folder (DOSDES) Define the folder to which the record is copied. The possible syntaxes are described in the dedicated appendix.
Error messages
The only error messages are the generic ones.
Tables used
Refer to the implementation documentation.