Applies to version 2020.1.x; Author: Paweł Drab
Contracts, employment applications, invoice templates or technical documentation – a repository of documents in our company can grow to incredible proportions. In this article we will show you how to use WEBCON BPS to store and manage these documents.
In WEBCON BPS, we usually store documents in the following places:
- As attachments in dictionary processes for templates
- In the SharePoint library
- As an attachment to any instance
- On a network share
There is no one definitive way to store this type of file – the approach to managing the repository of templates should be clear from the technological capabilities of the environment in which we work and the business requirements.
Dictionary process for document templates
WEBCON BPS 2020 version introduced several new features which will be a great solution for users of the StandAlone version that don’t use SharePoint. We have added the ability to create your own dictionary processes and document repositories which can replace the lists and documents libraries known from SharePoint. You can find this functionality both in the StandAlone version and for installations with SharePoint.
Let’s focus on creating a document repository. A new process that will be a source of document templates for us can be easily created from a simple wizard (available in the WEBCON BPS Designer Studio in the “Tasks” tab). This type of process doesn’t use the process licenses – so depending on the business needs, you can easily create several dictionaries.
Fig.1. Creating a new document template process – wizard placement
Like in any typical process wizard, you must provide the name of the process, acronym, workflow name, instance number and indicate a business administrator.
After creating the process, we will have two form fields called ID and Active (checkbox form field with yes/no option). You can also add additional form fields. The dictionary process uses only one Start step and in WEBCON BPS Designer Studio we cannot add any further steps to the workflow. However, you can add your own paths and actions on them and create a simple process (ex. attachment approval process).
Only one attachment can be added to each workflow instance in the document templates process.
For each dictionary process, a data source of the new “Templates” type is automatically created. By default, the documents marked as an ‘inactive’ don’t appear on the list.
On WEBCON BPS Portal, you can create a Start button and a report for the document template process, and both can be added to any dashboard. Instead of creating a regular report, we recommend creating a new dedicated form of report – Document templates – dedicated for processes of this type. Most settings are identical to those we have seen in regular table reports on Portal, but the dedicated Document Template report comes with a number of preconfigured options, e.g. buttons for exporting and importing files on the top bar.
One of the basic functionalities of the new dictionary processes is the ability to export and import them between environments. This is done by generating Excel and ZIP files. To maintain proper file references between environments, in dictionary processes, the instance identifier is the GUID (The file format is shown in the graphic below). If the GUID information of a given file is removed from the Excel file, it will be considered by the system as a new. This will assign a new GUID to it and create an instance in WEBCON BPS. In this way we can import a large number of files without having to enter data through the form.
A new report also allows you to download or view a file without getting into it.
Let’s try to use the documents in the library to add a Word document to the instance. First, we must create a choice field form field whose source is the list of documents templates. Because the filter that checks if the documents are active is already implemented, we will see only those documents that have the ‘active’ status enabled via checkbox. Next, in the configuration of the document generation action, we must specify that the source of our template is to be a process. The file path should be in the format “/ DOCTEMP / <GUID>”. “DOCTEMP” specifies the name of the form that stores the file, GUID is its identifier.
This type of solution can be implemented without any problems on the StandAlone environment. This way of storing document templates has many advantages, among others: predefined data sources, extensive reports with the possibility to preview and download the attachments, and the possibility of importing/exporting.
Storing files in the SharePoint library allows you to easily share and catalog them. All documents can be easily accessed from mobile devices. The authorization management system allows access to add or edit content only to persons authorized to do so. The files can be edited simultaneously by several people and their subsequent versions are possible to be inspected and compared with each other. The metadata system helps to find the document we are interested in, even when we are not sure of its location and name.
In the WEBCON BPS we can use SharePoint libraries in several ways:
- As an external documents repository (by adding the attachments on the SharePoint lists)
- As a source of documents templates:
a) In ‘generating documents’ action (Word, Excel, PDF, HTML)
b) In ‘adding the attachment’ from the SharePoint list
We should start our steps by creating a SharePoint library that all templates can be stored in. It’s a good practice to add a few columns that will allow us to add additional information about the files. In this case, we added the “Active” flag that informs us about if this file is the final version or only an unfinished draft.
Such a library can be encapsulated with a process that will contain the basic template approval and editing workflow. By using the action of adding and removing files from SharePoint lists, it is possible for this type of list to be managed entirely from WEBCON BPS Portal.
Fig.11. The action of adding attachments to the SharePoint list
The next step in the configuration of a templates library is to add a SharePoint list type data source in Designer Studio. In the configuration, you should first create a connection to the SharePoint site and, and the a data source definition, where you indicate where the list is located. All columns describing the attachment will be returned by the source. The important information for us is the file name, the “Active” flag, and the GOTO_ITEM_URL field, which is a direct link to the file.
The source configured in this way can be used as a form field of the type ‘choice field ’. In this way, we will give users the opportunity to choose which template will be attached to the instance. In the configuration of the choice field, the GOTO_ITEM_URL field should be used – in the example below it was inserted into a technical form field and then used in the action of generating the Word file.
Fig.13. Configuration of the choice field, which sources is the SharePoint document library. The GOTO_ITEM_URL field contains a direct link to the document
An attachment to any instance in WEBCON BPS
The possibilities of SharePoint libraries are really big – but what to do if we don’t have access to it? We may create a documents repository directly in WEBCON BPS. These documents will be stored exactly as any other attachment added to an instance.
We should start our configuration by creating a process in which we will register and attach files – it will allow us to easily catalog documents and create data sources.
Unlike to the process supporting the SharePoint list, here we don’t need to configure any attachment sending actions – just attach them to the instance. It is recommended to add a parameter with categories to the attachments section.
To easily refer to the newly created repository, create a data source that will return the attachment ID (WFDataAttachmets.ATT_ID). The MSSQL database source is the best choice here. This type of source (like the source referring to the SharePoint list), can be used in the choice field to give users the ability to choose the right template. If we configure this picker so that the form field ID (ATT_ID) is returned in the ID field, we can then use it in the attachment generation action. This time in the action configuration it should be indicated that the template comes from the attachment whose ID we will indicate in the SQL query.
This type of document library allows you to completely cut off from SharePoint resources, which is important when considering the StandAlone version.
A much simpler way to store files is to add them to network shares. It allows you to quickly share files between employees. Unfortunately, the network share doesn’t have the possibility of advanced cataloging, searching and versioning files, and gives too much control over documents to users who have the rights to manage the contents of the directory.
In WEBCON BPS, files stored on a shared disk can be used, for example, in the action of generating a Word file. In this case, in place of the file link, provide the path to the document stored on the network share.