Script syntax for data warehouses

Script syntax for data warehouses

Relatics offers a powerful syntax to precisely define the information you want to extract from the Relatics workspaces. This article describes the building blocks needed to build a script for data warehouse interfaces.

Iterator

[Action]
    {@Id}
    {Name}
[.Action]

In the example above, [Action] is an iterator. By using an iterator in a script, Relatics is instructed to ‘iterate’ through all elements of the specified type element (e.g. Action). In other words, Relatics will go through every element in the type element Action. Between the iterator tags, Relatics is instructed to parse syntax for every iteration of the specified type (e.g. Action). In the example, this means that for every Action, the ID and Name are exported.

Notes:

  • An iterator can be recognized by brackets and the name of a type within the brackets. For example, [Action].
  • An iterator is closed by brackets with a dot and the type element name. A notation variant is brackets with a dot. For example, [.].
  • Multiple root iterators are allowed in a script. Nesting of iterators is not allowed.
  • Special syntax for Archived elements and Hierarchy is not supported on iterators.
  • Sort and filter are not supported on iterators. These actions need to be done in the data warehouse.

Inserter

[Action]
    {@Id}
    {Name}
[.Action]

In the script examples given earlier, you may have noticed model references between curly braces (e.g. {Name}). These so-called inserters are used to define which Relatics properties will be included in the output.

Notes:

  • What is between curly braces must equate to one value per iteration.
  • A single iterator can have multiple inserters.

Next to properties, system attributes can be used for inserters. System attributes are not defined by a power user but, instead, are predefined by Relatics. Inserters with system attributes can be recognized by the @ symbol. Notice how, in the example given earlier, the inserter {@Id} was responsible for printing the IDs of the Iterator Action.

System attribute Description
{@Id}
This system attribute prints the value in the corresponding element ID column (e.g. ACT-1).
{@DisplayName} This system attribute prints the value of the display name of an element part of a collection relation.

Relation

[Action]
    {@Id}
    {Name}
    [has responsible: Person]
[.Action]
[Person]
    {@Id}
    {Name}
[.Person]

In the example, the relation has responsible Person of Action is part of the script When adding a relation to the script, both the from-type element and to-type element must be added as root iterators. The relation itself is added to the from-type element iterator in the syntax relation name colon to-type element name, e.g. [has responsible: Person].