Please enable JavaScript to view this site.

InterFormNG2 Manual

Navigation: Designer > Design elements

Workflow variable element

Scroll Prev Top Next More

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, which can be used for e.g. for sending user defined variable information from the workflow to a template.

 

This section covers the workflow variables.

 

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 preceded $-sign e.g. in XPath expressions.

 

Important: Please note, that 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 need also to use the number function, when you increment the value e.g. like so:

NG2WorkflowVariableUpdateNumeric0001

 

 

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:

 

NG2WorkflowVariable0002

 

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

 

NG2WorkflowVariable0003

 

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:

 

NG2WorkflowVariable0004

 

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.