🔢Data input via Forms, using Roles to partition user activities.
Last updated
Last updated
For a demo example of following steps, here is the policy timestamp: 1675164605.096601003
Construct a policy in which one group of users can individually fill in and submit documents for approval and view their own documents’ status, and another group of users can view and take approve/reject actions on any of these user documents.
Assign ‘User’ and ‘Approver’ roles to users to partition them into groups where one can fill in forms and send resulting documents to approvals, and the other group would ‘approve/reject’ these documents.
Create schema and necessary policy elements to enable ‘form-filling in and submission’ and ‘approval’ workflows.
Create 3 containers which will be responsible for choosing a role, submission and approval documents correspondingly.
Assign these containers to appropriate Permissions: ‘no_role’, ‘User’, or ‘Approver’, and add the first containers into the RoleSelectionBlock.
See detailed information about the Roles in Example 1.
1.1 Go to ‘Schemas’ tab and create a new schema
1.2 To make sure there is some demo/test data content in this schema create 3 fields:
Organization name of type ‘String’
Start Date of type ‘Date’
End Date of type ‘Date’
Amount of type ‘Number to represent the amount of CO2 emissions for the time period (between the ‘Start Date’ and ‘End Date’)
2.1 Since the scope of this example includes input of multiple documents the Policy requires logic similar to what is known as ‘loop’ or ‘iteration’.
For this ‘interfaceStepBlock’ is required with ‘Cyclic’ option enabled. This will allow to return to the initial state after the document was saved.
2.2 Add ‘requestVcDocumentBlock’ into the ‘cyclic_container’
2.3 Then select the previously created Schema
2.4 Select ‘New UUID’ to configure automatic generation of unique IDs for each document
2.5 By default ‘requestVcDocumentBlock’ is displayed as a Form covering the entire page. To prevent this choose ‘DIALOG’ value for the field ‘Type’.
3.1 Add ‘sendToGuardianBlock’ into the container ‘cyclic_container’ immediately after ‘create_new_document’
3.2 Select data type and where to store the document
3.3 Create appropriate attributes to capture/store document status
Add ‘Status’ attribute and set the initial ‘New’ value for new documents
To display documents ‘interfaceDocumentsSourceBlock’ is used
1.1 Add ’interfaceDocumentsSourceBlock’ into the ‘user_roles’ container
1.2 Specify the needed columns, their titles and where the values will be taken for display
1.3 To retrieve the data from the database ’documentsSourceAddon’ block is used
1.3.1 Add ‘documentsSourceAddon’ to the ‘user_grid’
1.3.2 Select where to retrieve the documents from
1.3.3 Select the schema upon which the selected documents should be based on
1.3.4 Select ‘Owned by User’ checkbox which would filter in only the documents that are created by this user (this will disable the ability to view other documents)
To display documents ‘interfaceDocumentsSourceBlock’ is used
1.1 As in the previous section we added ‘interfaceDocumentsSourceBlock’ and configured displayed columns
1.2 Add additional column which would contain the ‘Approve’ button