Applies to version: 2020.1.x and above; author: Franciszek Sakławski
Introduction
During document processing, it is important to check the correctness of the entered data – mostly to make sure that an incorrect value doesn’t cause issues further down the workflow. WEBCON BPS gives access to multiple avenues of form validation: RegEx, ‘Validate form’ action, and the one we will be taking a closer look at– setting up a form rule on the path. This article describes the use of this functionality.
Description the functionality
During configuration the workflow path, in the “Parameters” tab there is an “Additional path validation form rule” field.
Fig.1. The “Parameters” tab
This field allows you to set an additional validation when going through a given path. You can include both the form rules (global and process), business rules (global and process) and a JavaScript. If you do not want to use the predefined rules – there is the ability of writing your own condition.
Business case
A simple Invoice cost workflow was created that can be downloaded from -> Invoice processing.
Fig. 2. The Invoice workflow
From the “Registration” step comes the “Submit to analyst” path that contains the rule checking whether to the given invoice document a paper scan with attachment is added.
If the attachment is not added, the user will be able to decide whether the instance should be moved forward or remain in the current step. To set this rule, enter the “Submit to analyst” path configuration and go to the “Parameters” tab. Then click on the three dots icon on the right:
Fig. 3. The “Parameters” tab
After opening a new window, you can proceed to create the rule. The most common conditional function available in WEBCON rules – IF ELSE was used. The IF clause checked whether an attachment was added by using the ATTACHMENT EXIST function.
Fig. 4. The “Attachment exists” rule
We will limit ourselves to checking whether there is any attachment attached to the Invoice. So, we will specify “* [.] *” as the parameter. In this way, the system will check if there is any file with a dot in the name next to Invoice.
In the ELSE clause a message asking the user whether the document is to be further processed, will appear.
Fig. 5. Edit the expression
After configuring this option, go to the Portal:
Fig. 6. The Invoice form
After correct filling out the form, click the “Submit to analyst” button. For the above form (Fig. 6), the attachment was not added:
Fig. 7. The message
After clicking the “OK” button the system will go to the next step, while clicking the “Cancel” button – allows you to return to the form. In our case a form without attachments has been created by clicking the “OK” button.
Fig. 8. The “Analytical breakdown” step
Summary
Embedding the correctness rule on the workflow path is a convenient and fast way to verify fields. In addition, it simply limits calling the rule to a specific place of the workflow. Verifying the correctness of the entered data allows you to avoid mistakes and therefore spend less time correcting them.