From f82be35fb00c838da6cd39ddc5cc2081f7317ffe Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Wed, 17 Nov 2021 17:37:46 +0000 Subject: [PATCH] Add ADR for form routing logic --- docs/adr/adr-009-form-routing-logic.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/adr/adr-009-form-routing-logic.md diff --git a/docs/adr/adr-009-form-routing-logic.md b/docs/adr/adr-009-form-routing-logic.md new file mode 100644 index 000000000..72aa4d2f0 --- /dev/null +++ b/docs/adr/adr-009-form-routing-logic.md @@ -0,0 +1,12 @@ +### ADR - 009: Form Routing Logic + +There are 2 ways you can think about form (page) routing logic: + +1. Based on the answer you give to a page you are navigated to some point in the form, i.e. a "Jump to" +2. Each question is considered sequentially and independently and we evaluate whether it should be shown or not + +Our Form Definition DSL takes the second approach. This has a couple of advantages: + +- It makes the check answers pattern easier to code as you can ask each page directly: "Have the conditions for you to be shown been met?", with approach 1, you would effectively have to traverse the full route branch to see if a particular page was shown for each page/question which adds complexity. + +- It makes it easier to look at the JSON and see at a glance what conditions will show or hide a page, which is closer to how the business logic is discussed and is easier to reason about.