Search…
Generating documents (ReportingCloud) - Ritense
Go to the ReportingCloud website.
To generate documents we use ReportingCloud, a third-party service where we can generate documents using templates in combination with variables from the document of the process. These documents are then available in the "Documents" tab within Valtimo (The tabs can be found when looking at the details of a case).
Step 1: Upload template to ReportingCloud
On ReportingCloud we click on “Templates” in the menu on the left. Here we see all templates that have been previously uploaded and are available for file generation.
At the top we see an upload field, upload the template you want to use here. If you don't have an existing template, you can also create a new one.
Step 2: Expression in the BPMN model
On the service task in the BPMN model we have to add an expression to generate the document. Click on the service task and add the following expression:1${processDocumentGenerator.generate(execution, "application/pdf", "Template.docx")}
Replace "Template.docx" with the name of the template as uploaded to ReportingCloud.
This is all we need to tell ReportingCloud to generate a document. All variables from the process document are now available within the ReportingCloud template.
Step 3: Edit the template within ReportingCloud
Editing the templates within ReportingCloud largely works like any other word processor, but there are a number of things that work slightly differently. Here are some of these to get you started:
Limitations within ReportingCloud
There are a number of limitations within ReportingCloud that can make it very difficult to set up a template quickly. For example, it is not possible to copy content from one template to another template. It is therefore best to make sure that you format the template as much as possible in Word before uploading it to ReportingCloud.

Open the template in the ReportingCloud editor

In the templates overview we click on our new template, we will end up in this screen:
We don't have to do anything else here. We do not need the drop-down menu for the data source and can therefore remain empty, we only need this if we want to use static test data.
Now click on "Edit Template" to open the editor.

Add variables from the process document definition

If the service task in the BPMN model is correctly set (step 2), all variables from the document definition are immediately available in ReportingCloud.
In the "Reporting" menu we have a number of options for adding variables.
Fields that we want to replace in the template with data from our process document are called "Merge Fields" in ReportingCloud.
Under "Insert Merge Field" we find "Insert Custom Merge Field". We use this to add a variable from our document definition. If we click on it, we get the following options:
  • In the "Name" field we enter the variable as defined in our document definition.
  • At "Format" we can choose how ReportingCloud should handle capitalization. So if we want to be sure of a particular format, it can be selected here.
  • Under "Merge Field Options" we have a number of options for adding a prefix, suffix or determining a date or number format (dd-MM-yyyy for example).
If we now click "OK", the field has been added to our template.

Edit or remove variables from the process document

To edit or delete a merge field, right click on the merge field. We then get the option "Field Properties ..." to edit and "Delete Field" to delete the field.
You cannot delete the field with "delete" or "backspace".

Display text based on a boolean in the process document

We can display text based on a boolean in the document definition. There are a number of limitations to this.
From the "Reporting" menu we choose "Insert Special Field" and then "IF".
We now get the following options:
  • At "Field name" we enter our variable from the document definition, in this case this is a boolean but this can also be a string or number.
  • At "Compare to" we then fill in what we want to compare the variable with.
With booleans we use "True" or "False" with capital letters, without capitals it does not work.
  • "Insert this text" is the text we want to display if the if statement is "True".
  • "Otherwise insert this text" is the text we see if the if statement is "False".
We can leave "Otherwise insert this text" empty but it will always show a blank line. This is a limitation within ReportingCloud. With multiple IF fields, one below the other, there is a good chance that you will get multiple blank lines.
There is a possibility to remove empty fields but this will have to be done within Valtimo with "removeEmptyFields", this is currently not built in: https://docs.reporting.cloud/docs/endpoint/document/merge
Last modified 4mo ago
Copy link