Configuring a plain text template

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Document Templates > Configure the Document template >

Configuring a plain text template

From the Configuration Wizard follow the next steps:

 

1. Upload the .txt template.

To upload a template click the Plus icon.

 

DocumentTemplates11

 

In the new window click the Browse button, select the template for upload and click Open. Make sure the template is not opened elsewhere in order to successfully upload it.

 

DocumentTemplates102

 

If desired, change the template name. Click Next.

 

DocumentTemplates128

 

A new window will display a preview of the template along with the list of tags found in the template. Click Finish.

 

DocumentTemplates103

 

2. Define the document name.

This field contains the name of the actual document that is generated in the Work Portal.

 

DocumentTemplates15

 

If the property Replace existing documents is turned off, and the end user click Generate several times multiple documents of the same template will be generated. These will be named with the Document name followed by a sequential number.

 

For example if Invoice is the Document name, when creating a second document of the same template it will be named Invoice1 as shown below.

 

DocumentTemplates111

 

3. Map the information from the Process data model.

This option allows relating the Template Tags with the data model of the Process.

Click the Add Mapping button to open the mapping wizard

 

DocumentTemplates104

 

A new window will display.

In this window you will find the attributes of the Process Data model on the left and the Template Tags on the right.

 

You can easily relate a Data source to a Tag by tracing a line between the desired elements.

To do so, click an element of the Data Model and then click the corresponding Tag. You can also drag and drop the relation. This procedure must be repeated for each tag.

 

When needed, Runtime entities information is available to be mapped, from the Case attribute, just above the Process entity.

 

Take into account that mapped information will keep the format of the template.

 

DocumentTemplates17

 

For the Invoice template this would be the complete mapping.

Note that in the Tags table a group of Products was created containing the values of the Products collection.

 

DocumentTemplates35

 

note_pin

You can include filtered collections, today's date and some case information to your mappings. Please refer to Advanced functions in mapping

When mapping collections (including Runtime entities) remember to map the collection node as well as the attributes within the collection

When mapping parameter entities, expand their attribute nodes and map the Display Attribute.

When Bizagi generates a Document Template, and receives a date that has a null vale, it will not be shown in the final output

When mapping the root node of the document temple, the following warning appears

 

DocumentTemplates136

 

4. Define the export format.

Select the format in which the generated document will be exported.

 

Available formats are:

 

PDF: Exports the document in PDF format to make sure the aspect and structure of the original document is not modified.

Same as template: Exports the document in the same format of the Template. This will generate a txt file (unless you change the extension as explained below)

PDF/A-1a: Exports the document in PDF/A -1a format to make sure that document content can be searched and reproduced.

PDF/A-1b: Exports the document in PDF/A -1b format to make sure reliable reproduction of the visual appearance of the document.

 

DocumentTemplates77

 

If you choose Same as template a new field will display to type the desired file extension.

 

DocumentTemplates106

 

5. Finally, select the language for the tags in the template.

 

DocumentTemplates138

 

Generating a plain text Document

Once configured you are ready to generate documents.

 

Go to the Work Portal and open the Activity where the document is generated.

Include the necessary information in the fields of the form. When finished click the Generate Document button.

 

If you generated automatically make sure the expression has been executed.

 

 

DocumentTemplates22

 

Once generated, click the document link to open it.

 

DocumentTemplates107

 

This is how the document looks. Note how the information entered in the Form is included.

 

 

DocumentTemplates109

 

If you would had chosen PDF as export format, the document would look as follow:

 

DocumentTemplates110

 

note_pin

If the Document template has unmapped tables, the output will display the Foreach tags that have been left empty.

The Template must be mapped in Bizagi Studio.

Example: [Foreach:Customer]  [Name]   [Phone] [End]

When using Foreach and End tags or phrases be sure to capitalize them as specified. Otherwise, it will not be possible to identify the starting or ending point of the collection.


Last Updated 7/14/2023 2:23:31 PM