Business Process Designer > Business process modeling > Graphical elements / Generate from template

Generate from template

The Generate from template activity allows you to create documents in a business process by using templates uploaded to the system. The system automatically inserts relevant process data into the document.

As a result, you have, for example, a contract that already includes the signing date, the contractor's name, and the contract price.

начало внимание

Only users included in the Administrators group can configure the Generate from template element.

конец внимание

Configuring the Generate from template element

On the process page, go to the right pane and open the System elements tab.

01.PNG

Drag the Generate from template element to the process diagram and place it in the spot where you need the system to create a document.

In our example, we need to create an equipment purchase contract right after the Fill in order task and before the Sign contract tasks.

13.PNG

Double-click on the Generate from template shape to open its settings.

1.PNG

  • Name - specify the name of the operation as it will be shown in the system.
  • Document template - select a template. Please note that templates added to a workspace or an app can only be used in business processes created in the same workspace and app.
  • Generated file - select the file that will store the created document. Make sure that you have previously added a File variable to the process context.
  • Generated file name - by default, the generated document file will be named after the selected template. You can specify a different name if needed. For naming the file you can also use properties of the process variables and the DateTime function. To add a variable, click {+} on the right side of the field. To use the DateTime function, click {f }. You can read more about using the DateTime function in the Item Name article.
  • Convert to PDF - check this box if you want the document to be converted to the PDF format.

After having filled out all the fields, click Save.

The Field values tab will appear in the settings window.

The left column shows document template variables. In the right column, you have to specify the corresponding process variables. The values of these variables will then be added to the generated document.

178.PNG

During the process, the document will be created only if values are assigned to all of these variables. Make sure that you have added them to the forms of the tasks that stand before the Generate from template element in the process.

The variable that you have specified as Generated file will store the generated document. Do not forget to add it to the Sign contract task so that the user can open or download the document.

Save and publish the process.

2.PNG

When executing the process, the employee responsible for filling out the order will enter the contractor's name, the purchased equipment, the name of the contact person and the total amount to be paid.

The contract template will be automatically completed with this data. The next process task is Sign contract. Its page will feature a field with the attached contract.

4.PNG

The employee who is completing the Sign contract task can simply click on the contract, view it, and print it out.