For a demo example of following steps, here is the policy timestamp: 1675176247.137536341
Create a report to check a chain of documents.
We will use example 4 to assemble multiple documents to build a realistic-looking Trustchain.
Letโs add several additional attributes into the documents to simplify the document search.
Using the โreportBlockโ
1.1 Add new container
1.2 Add โreportBlockโ
In Guardian policy โreportBlockโ finds VP documents based on their id or hash and displays document information, related policy and token information. To retrieve the linked information โreportItemBlockโ must be used.
1.3 We will build the following chain in this example: mint _VP โ MRV Report โ Project (approved and signed the the Approver) โ Approver document โ Project (created and signed by the user) โ User document._
We will need 6 โreportItemBlockโ items correspondingly, 1 per each document.
The โreportItemBlockโ items are executed sequentially, thus in the filter for each consecutive โreportItemBlockโ we can use values from the previous blocks/documents.
1.3.1 โmint_documentโ. To find this document which described the token mint operation we will use one of the Common Variables - actionId
1.3.2 โreport_documentโ. To find the MRV report (i.e. data document which was the basis of the decision to mint tokens) we will also use one of the Common Variables โ documentId
To find further documents we will need to use values from the Ref variable which point to the previous document. Letโs save in a new variable:
1.3.3 โproject_document(approver)โ - Lets use the previously defined variable alongside the static filtration parameters.
Save the author of the document signature so we can display the information about the user later
Use the same approach to continue the chain until the end.
1.3.4 โapprover_documentโ
1.3.5 โproject_document(user)โ
1.3.6 โuser_documentโ
To activate the โreportBlockโ an id or a hash of the VP document is needed, we will add the grid containing the list of the VP documents and links to the trustchain.
2.1 Add โinterfaceContainerBlockโ, โinterfaceDocumentsSourceBlockโ and โdocumentsSourceAddonโ
2.2 Add new column with the type BUTTON
Setting the Action to LINK will cause the Policy Engine to attempt to switch the display to the target policy block upon the user clicking the link (if possible).