Applies to version: 2020.1.x and above; author: Dawid Golonka
In WEBCON BPS you can create simple workflows consisting of several steps and form fields, but you can also use the subworkflows mechanism. The following article describes the action connected to subworkflows – “Update related workflow instance”. This action allows you to change the value of the form fields in the parent workflow. More experienced system users can associate the previous name of this action, which was changed in the 2016 release – it was previously called “Update the parent workflow”.
The proper configuration of the action to which the article applies can be found in the second part of the text in the section “Configuring the action – Update related workflow instance”.
The simple workflow was created to support the registration of a contract. There is also the ability of adding the annex to the contract – it is implemented in the separate subworkflow.
Configuration of the parent workflow – Contract
Fig. 1. Contract workflow
The registration of contract workflow consists of three steps:
The following screenshots show the configuration of the “Hyperlink” action used to start the annex subworkflow (this is one of the options to run the subworkflow).
Fig. 2. The “Hyperlink” action
Fig. 3. The configuration of “Hyperlink” action
In the expression edition window select the “Start Element (…)” function and then the “Parameters mapping” option.
Fig. 4. The configuration of “Hyperlink” action
In the hyperlink edition window enter the necessary information about the workflow which will be started:
Fig. 5. The configuration of “Hyperlink” action
The second workflow allows you to register an annex to the contract.
Fig. 6. Annex registration workflow
When starting the Annex subworkflow, the values of the form field from the contract register workflow has been transferred to them. At the first step of the annex workflow, you can change the values of the selected form field. On entry to the “Annex registered” step the “Update related workflow instance” action has been created that allows to transfer of changed form field values to the contract workflow and overwriting existing ones. Real data will appear in the registered contract form – including corrections and changes made in the annex.
Configuration of the “Update related workflow instance” action
Below there is a configuration window of the “Update related workflow instance” action. It has been divided into three configuration panels – Basic, Advanced and Data.
Fig. 7. The Basic configuration
The tabs window consists of two parts – the configuration options are on the left and on the right – variable editor window.
The Basic tab:
Element selection mode – defining the mode of the selecting workflow instances which will be updated using the action. Three options to select from:
Process – selecting the parent process is necessary to set the form fields of the parent workflow in the table of setting the parent workflow form fields value in the “Data” tab.
Comment – the field allows you to add a comment informing e.g. about the reason for the update.
The “Advanced” tab:
Fig. 8. The Advanced configuration
The “Data” tab:
Fig. 9. The configuration of the “Data” panel.
The “Data” tab allows you to set the form fields values of the parent workflow instance. The “Value” column can be filled in manually or by using the tag wizard on the right. The “Overwrite value” column allows you to select those form fields whose values will be overwritten in the workflow even, when the field data already has a value assigned to them. Otherwise, the form field value will be set in the situation when the form field value of the parent instance will be empty.
The above screenshots show the configuration of the action related to our example business case. Only the “Contract valid until” and “Contractor’s address” form fields will be overwritten – other data will not be possible to change via the contract annex. On the contract’s form the comment with information about the transfer of data from the annex, also be added.
The presentation of the functionality in Portal
The business contract has been registered – the screen below presents the view of the form in the “Contract registered” step.
Fig. 10. The “Contract registered” step in the contract workflow
Selecting the “Register the annex” option starts the “Annex registration” subworkflow – the values from the parent form will be transferred.
Fig. 11. The “Annex registration” step
In the example annex there is the ability of changing the registered contractor’s address and contract valid – these two fields are left in edit mode, the reaming ones – are set as read-only. After changing the form fields value and adding the annex file, the workflow goes through the “Register” step.
Fig. 12. The “Annex registered” step.
As you can see in the screenshot above, the changes introduced in the form fields have been saved. The next step is to check if these changes have been applied to the parent workflow (contract form). Go to the contract workflow and refresh the form.
Fig. 13. The “Contract registered” step in the contract workflow – updated data on the form
The values in the parent workflow were updated, the comment also was added.