8.18.32016-03-14

Data Selections in PReS™ Workflow

A data selection is simply a reference to a given location within the job file or metadata file, using the current emulation. Data selections are always evaluated at runtime so they are always dynamic and depend on the job file that is currently being processed. When you make a data selection, the PReS™ Workflow Configuration program converts it to text form, using coordinates to reference the selected location.

There are three types of data selections you can use in PReS™ Workflow. The available type of data selection depends on which emulation you are using and whether or not you have created Metadata.

You can add data selections to variable properties of your tasks either automatically using the data selector (see The Data Selector) or manually by typing in the data selection.

It is strongly recommended to use the automatic method, as it returns precisely the same selections but is generally more reliable

Text-Based Data Selections

These selections are used for text data files such as Line Printer, ASCII and Channel Skip emulations. The selection refers to a rectangular selection that may contain multiple lines, rows, columns on a given page.

Syntax

@(page number, from line, to line, from column, to column, case option, trim option)

Here is a breakdown of the syntax (all options are mandatory):

Alternate Syntax

@(line number, from column, to column)

The alternate "quick" syntax lets you grab data from a single line from the first data page in the file. Here is a breakdown of the syntax (all options are mandatory):

Database Data Selections

These selections are used for database-driven data files such as Database and CSV emulations. The selection refers to a specific field on any given data page.

Syntax

field(record set number, child number, field name, treatment of character case, treatment of empty trailing cells)

Here is a breakdown of the syntax (all options are mandatory):

PDF Data Selections

These selections are used for PDF data files. The selection refers to a specific area of any given page of the PDF by using precise region coordinates (in inches).

Syntax

region(page, left, top, right, bottom, case option, trim option)

Here is a breakdown of the syntax (all options are mandatory):

Metadata Selections

These selections are used with any type of file, as long as a metadata file was created by a previous task.

Syntax

GetMeta(Field Name [, Option Flags, Metadata Path])

Here is a breakdown of the syntax:

Option Flags

Name Value Behavior
GetAttribute 1 Search for the name argument in the attribute collection instead of the default field collection.
NoCascade 2 Search only the level specified by the path argument (defaults to Page level when path argument is empty), instead of default behavior, going from the Page level to the Job level.
FailIfNotFound 4 Raise an error and crash the job is the specified name is not found instead of returning an empty string.
SelectedNodesOnly 8 Returns values from the selected nodes only.