Skip to content

Commit 8a7d771

Browse files
committed
docs(versioned_docs/version-0.22): add high-level-architecture.md - accordproject#275
1 parent a91a28d commit 8a7d771

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

website/i18n/en.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,18 +623,30 @@
623623
"version-0.21/version-0.21-tutorial-vscode": {
624624
"title": "With VS Code"
625625
},
626+
"version-0.22/version-0.22-high-level-architecture": {
627+
"title": "Concepts and High-level Architecture"
628+
},
626629
"version-0.22/version-0.22-markup-preliminaries": {
627630
"title": "Preliminaries"
628631
},
629632
"version-0.22/version-0.22-ref-cicero-api": {
630633
"title": "Cicero API"
631634
},
635+
"version-0.22/version-0.22-ref-cicero-cli": {
636+
"title": "Command Line"
637+
},
632638
"version-0.22/version-0.22-ref-concerto-api": {
633639
"title": "Concerto API"
634640
},
641+
"version-0.22/version-0.22-ref-concerto-cli": {
642+
"title": "Command Line"
643+
},
635644
"version-0.22/version-0.22-ref-ergo-api": {
636645
"title": "Ergo API"
637646
},
647+
"version-0.22/version-0.22-ref-ergo-cli": {
648+
"title": "Command Line"
649+
},
638650
"version-0.22/version-0.22-ref-migrate-0.21-0.22": {
639651
"title": "Cicero 0.21 to 0.22"
640652
},
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
id: version-0.22-high-level-architecture
3+
title: Concepts and High-level Architecture
4+
original_id: high-level-architecture
5+
---
6+
7+
![](/docs/assets/cicero-spec-overview.png)
8+
9+
## Step 1: Creation of Clause Template
10+
A legal professional analyzes a contract to determine the frequently used/standard clauses that are present. Clauses that are amenable to automation are extracted into a clause template. The template (more details follow) is comprised of the annotated legal text and an accompanying template data model that defines the assets, participants, concepts and events that are relevant to the clause. The business logic for the clause is coded by a developer (with review and in collaboration with the legal professional, or the suitably trained legal professional can code the contract logic themselves using the [Ergo](https://docs.accordproject.org/docs/0.13/logic-ergo) DSL).
11+
12+
## Step 2: Data Modeling
13+
Concept Template Data Model. The variables and expressions in a template are expressed in terms of a typed data model, that captures all the concepts of relevance to the clause. The data model technology allows importing concepts from namespaces, allowing concepts to be shared across templates.
14+
15+
## Step 3: Generation of the Template Parser
16+
The [Cicero Open Source project](https://github.com/accordproject/cicero) contains code that can automatically generate a parser from the annotated template text (template grammar) and the associated template data model. The parser generation is completely automatic and supports customization of types and nested grammars.
17+
18+
## Step 4: Create a Clause
19+
The generated template parser can now be used to dynamically edit and validate source clause text (potentially using code completion, error reporting etc). The editor technology can be embedded on a webpage, or executed as a SaaS service, or run within an IDE.
20+
21+
## Concept 5: Clause (instance of a Template)
22+
The output of the Template Parser is an instance of the Template Model (a JSON abstract syntax tree that can be deployed to the engine). It captures a machine readable (and hashable) representation of all the executable data extracted from the clause text.
23+
24+
## Step 6: Invoke Engine with a Request
25+
The application feeds JSON documents to the engine that represents the request instances, which themselves have been modelled in the Template Data Model. These requests represent events of significance to the clause from the outside world.
26+
27+
## Step 7: Execute and Return Response
28+
The engine invokes the business logic for the template, passing in the parameterization data, a context object and the incoming request. The engine validates the response and then returns it to the caller. The structure of the response is modelled in the Template Data Model.
29+
30+
Once a template has been created (Steps 1 to 4), it can be used to instantiate a contract (Step 5) which itself can be executed by the template engine (Steps 5 to 6). Both contract instantiation and execution are shown in greater details on the following figure:
31+
![](/docs/assets/execution_context.png)
32+
33+
>Note that the Accord Project specification does not assume a specific execution environment. [Cicero](https://github.com/accordproject/cicero), which implements the Accord Project specification, includes a Node.js VM based execution engine for contracts created from Accord Project templates. The engine routes incoming requests to template functions, performs data validation, executes the functions within a sandboxed environment, and then validates the response. It can also update the contract state and emit events and/or contract obligations back to the caller.

website/versioned_sidebars/version-0.22-sidebars.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"version-0.22-started-resources"
1414
],
1515
"Template Guides": [
16+
"version-0.22-high-level-architecture",
1617
{
1718
"type": "subcategory",
1819
"label": "Markdown Text",

0 commit comments

Comments
 (0)