Workflow - Working with Variables

Workflow - Working with Variables

Workflow allows you to parameterize the settings of each component in the flow and make decisions optional using variables:
There are 3 different types of variables:
  1. Keywords: User data generated from XML, JSON, XLSX, CSV, Database or RegEx
  2. Job XPaths: Data stored in the job, being the results of previous steps or result of the injection of XML or JSON.
  3. Meta: Meta data information about the documents associated with the job.
In the "Variable" tab of each component you can specify which items to override with a variable. When nothing is specified then the value of the "Static" tab is taken. The input can be specified using a mix of literal text and variables. Variables conform to the format:
{[Key|Job|Meta]:<name>}
An example for when a variable bleed is wanted and the data is stored under key "Bleed" as millimeters then the format would be:
{Key:Bleed} mm
The above parameter will replace {Key:Bleed} with the value, for example and form "3 mm".

Keywords

Keywords are Key/Value pairs that are stored in the UserData section of the job.
The UserData can be provided as section in the input XML or extract from XLSX, CSV, Databases or from the document filename using RegEx expressions.

XPaths

XPaths identify nodes or attributes in the job its XML structure. This XML structure can be inspected via the XML job. This allows to acces data from earlier steps or data injected with the XML or JSON hotfolder.

Meta

Meta data is a list of descriptive data of the first document contained in the job. The variables available are:
  1. Width : Width of the first page of the first document
  2. Height : Height of the first page of the first document

Rules based flows

Variables can be used to control the flow of jobs. By double-clicking a connector a filter condition can be added in 2 forms: JavaScript or only the if-clause. The latter makes a simplified decision/filter available without knowing JavaScript in full.

If-clause

Allowing any JavaScript style of condition like:
  1. == : when the values are equal
  2. != : when the values are not equal
  3. < : smaller
  4. > : larger
  5. <= : smaller or equal
  6. >= : larger of equal
The substitution rules as above apply. For example to only allow 3 mm bleed jobs the notations is:
{Key:Bleed} == 3

JavaScript

Full JavaScript with specific extensions to acces the PDF document are allowed. Define a function named "function()" that returns a bool. A JavaScript style function to increase test if the the bleed is larger than 3 and then double it would look like:

function() {
      if( Key.Bleed > 3 ) {
            Key.Bleed *= 2;
            return true;
      }
      return false;

Optional variables

Variables can be made optional by appending a question mark after the type; like Key?. When the keyword is exists it will be used. When the keyword is not defined it will be treated as if it is not defined and use the values from the "Static"-tab.

Parameter types

Parameters can accept the types listed below. The parameter type expected can be observed in the "Variable"-tab by hovering over the edit field, a tooltip with documentation will appear showing the expected type.
  1. String : any value
  2. Integer : negative and positive non-fractional numbers
  3. Real : any number
  4. Boolean : True or false
  5. Unit : Dimension or size defined in units (1/18"). See "Dimension modifiers" below.
  6. Percentage : Percentage, from 0 to 100.
  7. Path : Operating system specific path or UNC path.
  8. Enumeration : Any of the values listed in the documenation of the parameter.

Dimension modifiers

Dimensions and sizes are usually defined in the local unit system; imperial or metric. To automatically convert the number into a PrintFactory Unit (1/18") append one of the following modifiers after the parameter definition:
  1. " : inch
  2. mm : millimeter
  3. cm : centimeter
  4. dm : decimeter
  5. meters : meter
  6. pt : point (1/72")

Special keywords

  1. Copies
  2. Barcode

    • Related Articles

    • Layout automation from structured filenames

      Layout automation from structured filenames Layout (as of version 6.3) has 2 preference items tailored for automated flows where manual interaction is required. Typically when Enfocus Switch, Esko Automation engine or another workflow is present. In ...
    • Creating a new Workflow

      To create a new Workflow you first need to open the Workflow application. On a Windows PC, you will find it here: C:\Program Files\PrintFactory, and on macOS, here: HD/Applications/PrintFactory. After opening the application you need to click the ...
    • Creating Keywords using RegEx

      Workflow allows you to parameterize the settings of each component in the flow and make decisions optional using variables. You can read extended information about variables and their format in the article [here]. This article will explain in close ...
    • Workflow UI overview

      Workflow user interface
    • Working with Documents

      Creating a New Document When the application is started, a new document will be created automatically. It is also possible to create a new document manually (File menu > New). Defining the document size In the Document Setup dialog (File menu > ...