Applies to version: 2021.1.x and above; author: Konrad Wojtycza
The application designer can use several actions to generate documents from templates in WEBCON BPS. They are grouped in the group "Excel, Word and PDF".
Generate/Update Word file
The configuration of the Word file generation action consists of two tabs. In the "Template" tab, indicate the plug-in operation mode and the location of the file to be used to create the document.
In the "Result" tab, it is possible to define the name of the file under which the document is to be saved, its description, category and language of the document.
The document language selection options are as follows:
• According to the application settings,
• Permanently selected language from the list (e.g. de-DE, uk-UA etc.)
If the project of the designed application allows the user to select the language version, the value "According to application settings" should be indicated in the action configuration. Then it’s required to check the current settings of the application to which the template is to be connected.
On the main page of the application, in the lower left corner is a menu for selecting the language of the application.
Options that can be selected:
• According to global settings,
• According to user profile settings,
• Language indicated: (e.g. de-DE, uk-UA etc.)
In the described case, the language setting according to the user profile was used.
A simple workflow has been created to store employee cards, which contain basic information about the employed persons. On this workflow, it will be possible to generate a Word document containing data from the card.
In the form of the starting step, the employee's data should be completed (view of the form later in the article). After entering this data, the card is registered with the path "Register card", where it is possible to print it. The workflow also allows you to save the current version of the form and cancel work on the card.
In the employee's card workflow, information about the equipment assigned to a given person will be displayed in the “Data table” form field. The second "Hardware inventory" workflow was created, where information about equipment will be stored.
In the inventory workflow, information about the employee should be entered, as well as the name and serial number of the equipment that belongs to a given employee. After assigning the document, it goes to the "Equipment assigned" step. The form view at this step is as follows:
A laptop was assigned to an employee "Borys Szyc". In other workflow instances, he was also assigned a phone and a tablet.
Let's go back to the employee card workflow, below is a screenshot of the form at the registration step, the user using the system works in a Polish company and has Polish as the Portal language.
The employee card form has been completed. In the bottom panel of the form, there is a "Data table" form field, where information about the equipment assigned to the user in the "Hardware inventory" workflow has been loaded. In order for the workflow created by us to be displayed to users in the language indicated in the profile settings, a translation should be added to each form field.
The contract type field has a source configured to support multilingualism:
The permission’s item list columns have also been translated, as well as the column headings of the "Assigned Equipment" data table.
Two templates for generating an employee card have been created. Template in Polish:
Template in English:
In the English template, you can notice Polish names in the columns of the item list and in the columns of the data table. The template displays the text values from the "Original text" field from the form field translation section. The combination "Alt + F9" displays that there are references to system elements under these names:
Important! If you used the aforementioned key combination, before saving the template, use the "Alt + F9" combination again to switch to the standard document display mode.
Both document templates have been added to the document template created for the process workflow. Two constants have been created to store the ID of the templates from this process, one for the Polish template and the other for the English template.
Then, the "Select template language" business rule was created which, depending on the user language setting, will return the template document ID in the appropriate language. We will use this rule in the configuration of the Word file generation action.
Configuration of the Word file generation action
On the "Employee's card" step of the employee's card workflow, a button was added to generate a card. The button activates the action of generating a Word file with a card.
The choice of a document template depends on the language set on the Portal by the user. For this purpose, we will use the previously created business rule:
The configuration of the "Result" tab remains the same as in the figure no. 2 of this article.
The configured workflow can be used by companies and employees using different languages. The form shown in Figure "7" has been registered for a company where the employees speak Polish. At the "Employee's card" processing step, a card was generated while remaining in the Polish interface. The generated file looks like this:
As you can see, the card was printed correctly in Polish.
Now consider the case of using a workflow in an English-speaking company. The completed employee card form at the English interface is as follows:
After registering the workflow instance and generating the card, we obtain a Word file that corresponds to the language version of the form we are working on.
Values from checkbox, items list and SQL table are translated correctly.
By implementing the Webcon BPS software to support business processes in companies operating on the markets of several multilingual countries, it is possible to configure printouts from workflows so that they work properly, regardless of the interface language used by the users.