RepeatingWordTemplateHandler

Description

The ActionHandler RepeatingWordTemplateHandler makes it possible to create a Word document for several process variables. It is an extension of the https://tim-doc.atlassian.net/wiki/spaces/eng/pages/227675520. The process variables must be indexed using a number in square brackets (i.e. Variable[0], Variable[1], Variable[3]…). Then, each ${Variable} entry is replaced by one of the indexed variables. A new template is created for each index. It is also possible to merge all the created documents.


Class

com.dooris.bpm.actionhandler.RepeatingWordTemplateHandler

Parameter

Parameter 

Default value

Description

Valid examples

Parameter 

Default value

Description

Valid examples

template

 

This parameter is used to set the path to the template, so the actionhandler can search for it in the resources folder.

In order to access ‘Resources’ section under the 'Administration' please see: https://tim-doc.atlassian.net/wiki/spaces/eng/pages/228230965

/WordTemplate/dokument.docx

repeat

 

This parameter should be set to true in order to execute this actionhandler.

true

mergeDocumentName

 

This parameter is used to set the name for the merged documents.

Dokument

merge

false

This parameter is used to decide if the documents should be merged. All documents will be merged into one if this parameter is set to true.

true

repeatCounter

 

Name of a variable containing a number, which denotes how many indices are present.

counter

pdf

 

It can be either true or false. If the templates should be converted into PDFs the value must be set to true.

true

 

 

Example:

In the following, the use of the ActionHandler is briefly explained.

First, the ActionHandler is set up in the "Task1" in the process model.

The following parameters were used in this example:

Parameter 

Description

Valid examples

Parameter 

Description

Valid examples

template

Name of the word template that will be uploaded to the resources folder is set here.

test_template.docx

repeat

Here, true must be entered otherwise actionhandler won’t be executed.

true

repeatCounter

This parameter is used to set the index number and you need to enter this in advance. Also, we will create counter variable on the form, so the user can enter the number.

${counter}

pdf

 

true

merge

 

true

mergeDocument

 

MergedDoc

 

Secondly, a Word template is required (detailed explanation on how to create the template is provided in the WordTemplateHandler) . In the template document the variable department is used and for each department entered in the Form a Word document should be generated. This template should be uploaded to the resources folder in the administration.

As a third step, a form is needed. It contains three input fields with the indexed variables department[0], department[1], and the variable counter.

 

When starting the process, the fields must be filled in the Form.

 

After a successful execution you can see that three documents are visible in the "Documents" tab of the operation. The first document contains the department with the first index number ([0]). The second document contains the department with the second index number ([1]). The merged version of these two documents is also available.

 

You can see the content of the first two documents here. The third document is simply the merged version of the first two documents.

For marketing department

For finance department:

For marketing department

For finance department: