Skip to main content
Version: Any 26

Metadata composers

This module automatically computes the value of a metadata from other metadata, rather than having the user type it.

It answers the need to produce a normalized, typo-free value: a document reference built from the type, the year and a sequence number, a formatted label, a date derived from another. The value is recomposed by the flow that uses the composer, from the real content.

The value can be produced by:

  • A combination of other metadata
  • A computation
  • Counters

This module applies to contents as well as to business objects (Case): a switch in the navigation bar moves from one to the other. Several configurations can be created, then called from the flows.

Configuration​

Name: name of the configuration
Application: application concerned by this module
Metadata: metadata that is filled in or changed
Template: expression that produces the value, described below

In the Template field, typing ctrl + space after a character shows the assistance.

Template​

A template is a text where the values to insert are noted ${...}. Everything outside those wildcards is kept as is. The full syntax (available wildcards, indexing of the multiple values, transformation operations) is described in Wildcards and operations.

The counter configured on the same page is inserted with ${COUNTER}:

${core.name}_${core.creation_date | format('yyyy') | lowercase}_${COUNTER | format('00000')}
${standard.authors[0] | uppercase}

If the target metadata is multi-valued and the template itself retrieves a multi-valued metadata, the template is applied to each of the retrieved values to form the set of the new values.

Counters​

A counter supplies a sequence number that increments on each produced value. It is inserted in the template with ${COUNTER}.

Global: determines the scope of the counter.

  • A global counter is unique for the whole template, whatever the produced value. Its start value can be set.
  • A non-global counter creates a distinct counter for each unique result of the template, starting at 0. A template prefixed by the year thus numbers each year from 0.

Also tick the Global option if the counter must be shared by every application.

Value: current value of the counter.

Ranges​

The counter can be restricted to one or several ranges. Without a defined range, the counter is infinite.

Start: start value of the counter
End: end value of the counter

Selecting a range in the first column opens the menu to:

  • Change the order (move the value up or down)
  • Delete the range

Preview the result​

For contents, the "preview" button shows the result of the template on a real document.

The GQL query looks for the documents the template is tested on. Run it with the "Run query" button. Once the query has run, select a document to apply the template to it: the result appears below the list.

Flows​

This module can be used in the following flows: