Description
The ActionHandler RepeatingWordTemplateHandler makes it possible to create a Word document for several process variables. It is an extension of the WordTemplateHandler. 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 |
---|---|---|---|
|
| 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: Roles |
|
|
| This parameter should be set to |
|
|
| This parameter is used to set the name for the merged documents. |
|
|
| 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. |
|
|
| The |
|
|
| It can be either |
|
Example:
In the following, the use of the ActionHandler is briefly explained.
the ActionHandler is set up in the "Generate invoice", node leave event in the process model.
The following parameters were used in this example:
Parameter | Description | Valid examples |
---|---|---|
| Name of the word template that will be uploaded to the resources folder is set here. |
|
| Here, |
|
| For example we will set the counter to 3, and it will generate 3 documents out of it + if merge is true will create an aditional document which is a merge of all three documents in one place. |
|
| By setting to |
|
| By setting to |
|
| The name of the merged document will be set |
|
Word template is required (detailed explanation on how to create the template is provided in the WordTemplateHandler) . In the template document the variables
${invoiceto}, ${deliverto} ${amount}
etc... are used.
This template should be uploaded in Administration → Resources.
Inside the process model the form is setted up with six input fields using the indexed variables:
invoiceto[0]
,deliverto[0]
,amount[0]
,description[0]
,individualprice[0]
,total[0]
to match the parameters used in the handlerInvoiceto[0]
deliverto[0]
amount[0]
description[0]
individualprice[0]
total[0]
For the second template, the process variables must have the same name as the previous one but indexes start with 1. eg. invoiceto[1]
, deliveryto[1]
, amount[1]
, description[1]
, individualprice[1]
, total[1]
.invoiceto[1]
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 value from process variables having Index number [0] like invoiceto[0], description[0] etc… The second document contains the value from process variables having Index number [1] like invoiceto[1], description[1] etc... The merged version of these two documents is also available.
You can view the content of the first two documents here. The third document is simply a merged version of the first two.
First document:
Second document:
Merged documents: