Add diagram describing the mapping between Form and FormDocument objects#234
Add diagram describing the mapping between Form and FormDocument objects#234
Conversation
441060a to
fb1bc31
Compare
This was pretty confusing and creating this doc helped made it clearer to understand.
fb1bc31 to
0e174a4
Compare
| D -- points to --> G | ||
| E -- points to --> H | ||
| G -- points to --> I | ||
| ``` |
There was a problem hiding this comment.
I don't think this diagram makes a whole lot of sense. There isn't such a thing as a "check condition" or a "goto condition" really. We just have those associations on the page model to get all conditions where the check_page_id or goto_page_id point to the current page as it's sometimes useful to get these. If we want to explain how conditions relate to pages, I think the following is a better way to comprehend it:
The below diagram shows a primary condition (not sure whether we have a better name for these), which skips to Page 3 after Page 1 if the answer given to the selection question on Page 1 matches the answer_value of the condition. For primary conditions, the routing_page_id is always equal to the check_page_id.
flowchart TD
Form[Form]
Page1[Page 1]
Page2[Page 2]
Page3[Page 3]
Condition[Condition]
Page1 --> Form
Page2 --> Form
Page3 --> Form
Condition -->|routing_page_id|Page1
Condition -->|check_page_id|Page1
Condition -->|goto_page_id|Page3
We can also have secondary skip conditions. These cause page(s) to be skipped later on in the form if any answer other than the answer_value was given to the question on the page that the check_page_id references. In this example if any answer other than the answer_value on the primary condition was answered, the user will proceed to Page 2. After answering the question on Page 2, Page 3 will be skipped and they will proceed to Page 4.
flowchart TD
Form[Form]
Page1[Page 1]
Page2[Page 2]
Page3[Page 3]
Page4[Page 4]
Condition[Secondary skip condition]
Page1 --> Form
Page2 --> Form
Page3 --> Form
Page4 --> Form
Condition -->|check_page_id|Page1
Condition -->|routing_page_id|Page2
Condition -->|go_to_page_id|Page4
There was a problem hiding this comment.
TYSM @stephencdaly I'll update with these
This was pretty confusing and creating this doc helped made it clearer to understand.
Rendered: https://github.com/alphagov/forms/blob/add-model-mapping/diagrams/mapping-forms-formdocuments.md
PR Checklist
- (ADR, decision-record, engagement, research)
What
Describe what you have changed and why.
How to review
Describe the steps required to test the changes.
For example:
Who can review
Describe who can review the changes. Or more importantly, list the people
that can't review, because they worked on it.