Applies to version: 2021.1.x and above; author: Dawid Golonka
Introduction
When processing an instance in a given workflow, sometimes there is a need to change fields available to a user or manage privileges to the instance. You can use the “Change form type” action, which allows you to change the type of the form you are currently working on. This action is available only for the Menu button trigger.
Example workflow
An example workflow for registering contracts has been created. Access to individual contracts depends on the confidentiality level, which can be changed.
Fig. 1. The “Contracts” workflow
At the first step, a user adds the contract to the workflow as an attachment. Then, the instance goes to the “Archive” step, where the current contracts are located. You can withdraw or restore the contract. Privileges to read contracts are granted to people in defined groups and they depend on the form type. The “Change form type” action will be used at the „Archive” and “Canceled” steps.
Configuration of the action
To manage privileges, for each confidentiality levels create a separate form type in the system settings.
Fig. 2. Form types created in the system settings
Fig. 3. Privileges to edit data on the “Top secret” form for users from group “AU_C3”
Fig. 4. Privileges to edit data on the “Public” form for users from groups “AU_C1”, “AU_C2”, “AU_C3”
To change the confidentiality level, global action has been added – it is available at every step of the workflow. The “Change form type” action will be executed by using the “Change confidentiality level” button. (This action type is available only for the menu button trigger).
Fig. 5. The “Change form type” action available from the lobal actions level
Advanced configuration of the action
Fig. 6. The advanced configuration window
Example of use
In the example process, a contract was registered with the “Top secret” confidentiality level. Access to contracts will be granted to people from the C3 group (management board).
Fig. 7. Registration of a new contract
The instance goes to the “Archive” step. By using the “Change confidentiality level” button, a user can change the confidentiality level. This can be done by a user who has privileges to modify the process in the edit mode.
Fig. 8. The form at the “Archive” step
After clicking the button, a window will appear on the screen in which you should change the form type.
Fig. 9. Changing the form type
In the advanced configuration, the option to change the form type only within a given process has been selected, so the remaining fields used to change the application, process and workflow are inactive.
After the change, the instance goes to the registration step where the user can edit fields (according to the field matrix). As you can see below, for contracts visible for all users (Public level), information about the responsible person is not available on the form (the field has been disabled for this form type).
Fig. 10. “Registration” step after changing the form type
An important note is that when you use the “Change form type” action, the instance will have a new instance number, and the instance ID will not change (“3990”).
Fig. 11. Form with a new instance number
Important
If a user actively participated in the process or was granted the appropriate privileges (by using the action), then they should be removed afterward. Anyone who has been assigned a task or changed privileges can read the instance (documents). To revoke these privileges, use the “Remove privileges” action.
Fig. 12. The „Remove privileges” action