Workflow variable element

Workflow variable element

You can define two kinds of variables in your templates:

  1. A normal  variable, which is defined and used only within the template.
  2. A workflow variable that can be used, for example, to send user-defined variable information from the workflow to a template, or vice versa.

This section covers the workflow variables as used inside a template. The workflow variable element can be inserted with this icon:

Alert
The only place where you can define a workflow variable element in the designer is prior to the page element(s), so you should click the template element to add a workflow variable

 

The workflow variables can be created and updated only in the workflow with the two workflow components:

  1. Set workflow variable
  2. Set multiple workflow variables

Inside the template, you can refer to these workflow variables as input, but you cannot assign a new value to a workflow variable. If you want variables that you can create and update in the template, then you should use the variable element.

 

If you want to refer to a workflow element in a template, then you can simply type the name of the workflow variable with a preceding $-sign, e.g., in XPath expressions.

Alert

Important: A workflow variable is always defined as a string, so if you use such a variable as index in XPath, then you need to cast this as a number e.g. like so:
/Root/Document[number($Index)]/@Company.

Also, if you want to create a counter to keep track of the current number of repeats, then you also need to use the number function when you increment the value e.g., like so:


 

It is, however a good idea to define the workflow variables that you want to use in the template because of this:

  1. It is clear to see, which workflow variables, that the template is using as input, so you should consider to verify, that these variables are setup in the workflows, that are using the template.
  2. You can assign a preview/placeholder value in the designer and in this way directly in the designer see, how the template reacts to varies values of the workflow variable.
The only place where you can define a workflow variable element in the designer is prior to the page element(s), so you should click the template element to add a workflow variable:



Now you can add a new workflow variable with this icon:


 

In the workflow variable element you can let the template know, that a specific workflow variable is expected, and you can also assign a value to be used, when you are designing:


 

In the example above a variable, Copies is set to the value '2'. This can be used by the workflow to request a variable number of copies of the document, and the designer can use the repeat element to produce the same number of repetitions when printing the merged result.

 

So as mentioned above the value '2' set above only has an effect, when you are designing and previewing without a workflow. In production the value is expected to be set in the workflow by either set workflow variable or set multiple workflow variables.


You can use workflow variables with the workflow input type, From input form menu. In order to do that you need to setup the editable section of the workflow variable:
The fields are:

Unique Id
This must be a unique name for the workflow variable. A recommendation is to simply state the name of the workflow variable.

Form Label
The header/description of the workflow variable.

Default value
The default value for the workflow variable. This value will be shown when the From input form menu is run.

Free text/Selectable text
Here you can decide that the user should either enter a free text or select the value via a drop down list, which is setup via a translation file like below:


This will only list the keys that starts with Ba in the referenced translation file.


With the values specified above this entry screen will be shown for this template:



With the workflow variable element you can also refer to both tenant variables and global variables. You can see these variables if you click the magnifying glass:



    • Related Articles

    • Variable element

      It is possible to define one or more variables in the InterformNG2 designer. The advantage is, that you can use variables e.g. to add up all the detail lines of a page and output the page total in the footer. You can also use variables in normal ...
    • Text element

      If you want to insert any kind of text in InterformNG2, then you should use the text element. You can insert a new text element if you click on this icon: The data, that you can output as text are these types: A text constant Drag nodes from an input ...
    • Generic workflow

      One of the unique features of the InterformNG2 workflows is the ability to setup very dynamic and generic workflows. There are multiple advantages with a generic workflow: It is much smaller compared to a setup, that e.g. contains a whole subtree for ...
    • Print settings element

      This is relevant for PCL printing only. If you want to select between simplex (print only on the front of the pages) and duplex (print on both front and back) and/or select a specific tray on the printer, then you can use the workflow component, set ...
    • Choice workflow component

      The choice workflow component can be used to condition the processing of the files. The choice component can branch out to one or many cases (subtrees) depending on a condition for each case (subtree). When you insert a new choice component it will ...