Data Repository

The Data Repository is a permanent structure to store data that can then be reused, modified or augmented at a later time, by different processes.
This feature was introduced in version 8.5.

When to use the Data Repository

The Data Repository is especially useful in situations where data needs to be kept in between processes. A few examples:

  • An HTTP-based authentication process, once it has validated user credentials, could store session information (unique ID, user name, session starting time) into the repository. All other related processes could then look into the repository to determine if a new request is received from an already authenticated user, if the session has expired, what the user name is, etc.
  • Data comes in and is merged into a Capture OnTheGo template and stored in the Data Repository. The end-user augments the data (using the COTG as a data-entry system). The process that receives the augmented data could look into the Data Repository to retrieve the original data (or the ID of the original data records) in order to augment, modify or delete it.

Structure

As can be seen in the Data Repository Manager, the Data Repository consists of Groups, Keys and KeySets.

Feature Name Description Equivalent Database Terminology
Group A Group is defined by its Keys (columns), and may contain 0 or more KeySets (rows) within it. Table
Key A Key is defined only by its name. The Data Repository only supports STRING values and any data inserted into it is converted to string automatically. The maximum size of a single key is 1 billion bytes. Column/Field
KeySet A group may contain as many KeySets (rows), which contain variable data, as necessary. A KeySet is inserted using the Push to Repository task. Row/Record
Lookup A method of retrieving one or more KeySets from a group in the data repository. Query

Accessing the Data Repository

Via plugins

Storing data in the Data Repository

Data can be stored in the Data Repository using the Push to Repository task (see Push to Repository).

Retrieving data from the Data Repository

In any Workflow task where variable data is allowed (recognisable by the maroon field labels), information can be retrieved from the Data Repository using a Lookup function. Right-click a field with a maroon label and select Get Repository Location. This will bring up the Data Repository Manager. Select a Group, Key and KeySet entry to determine which value or values should be retrieved at runtime; then click OK. The Lookup Function Syntax, displayed at the bottom left of the Data Repository Manager, will be copied into the field.

The syntax is of the Lookup function is:
Lookup(Group_Name, Key_To_Retrieve, Key_To_Match, 'Value_To_Match')

Note: Value_To_Matchcan be a static string, a jobInfo or a variable, but not a data selection.

For the Value_To_Match parameter, the single-quotes surrounding the value are mandatory even if the value is dynamic.

This function may also be used anywhere else where the contextual menu gives access to it. You could, for example, use it on the General tab of the Create File task, to fill in the value of a key/value pair in a JSON string.

Tip: The Data Repository Manager displays, at the bottom left, the syntax used for accessing a specific value.

Note: Lookup()returns NODATA when the group and/or key does not exist.
In previous versions of the software, trying to do a look-up in a non-existent group and/or key would cause an error. This change in behavior may affect any Workflow configuration that uses an on error process related to invalid groups/keys.

Scripts

In a script you can access the Data Repository using the Data Repository API.

For a quick start, turn to this How-to: Interacting with the Data Repository API.

Data Repository Manager

At design-time, the Data Repository Manager may be used to insert or remove Groups, Keys and KeySets; see Data Repository Manager.

Where to find the Data Repository

In case the Repository contains valuable information that must not be lost in case of a hardware failure, create a backup of the repository.
By default, the Data Repository is located in the following folder:
%ProgramData%\Objectif Lune\PlanetPress Workflow 8\PlanetPress Watch\Repository.

It is also possible to create a Repository at a custom location; see ConnectionString.