-
Notifications
You must be signed in to change notification settings - Fork 0
/
flows-config-schema.json
111 lines (111 loc) · 6.13 KB
/
flows-config-schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Flows Configuration",
"type": "object",
"required": ["name", "flow"],
"properties": {
"name": {
"type": "string",
"description": "The name for a given flow. This is used to identify the flow in the URL that will be displayed for a given flows screens. Additionally, this will,be the name that is displayed for the flow in the database JSON."
},
"flow": {
"type": "object",
"patternProperties": {
"^.*$": {
"type": "object",
"description": "The configuration for a given flow, including screens, their next screens, conditions and actions, as well as subflows.",
"required": ["nextScreens"],
"properties": {
"nextScreens": {
"type": ["array", "null"],
"description": "Required, an array of next screens or empty.",
"items": {
"type": "object",
"required": ["name"],
"properties": {
"name": {
"type": "string"
},
"condition": {
"type": "string",
"description": "The name of a Condition whose run method will be executed to determine if a screen is shown next."
}
}
}
},
"onPostAction": {
"type": "string",
"description": "On POST - An action of this type is run when data has been sent to the server, but before any validation has been performed on the data. It's a way to inject/update any data before any validation occurs."
},
"crossFieldValidationAction": {
"type": "string",
"description": "On POST - An action of this type is run after data validation and just before the data is saved to the database. It's a spot that data can be updated before it is saved. An example would be encrypting any sensitive data. Note that since validation has been done before this point any changes to data will not be validated before being saved."
},
"beforeSaveAction": {
"type": "string",
"description": "On POST - An action of this type is run after data validation and just before the data is saved to the database. It's a spot that data can be updated before it is saved. An example would be encrypting any sensitive data. Note that since validation has been done before this point any changes to data will not be validated before being saved."
},
"afterSaveAction": {
"type": "string",
"description": "On POST - An action of this type is run after data has been sent to the server and saved to submission. It's a way to add a hook into a page after a save. For example, you could add a method that sends an email or fires a task after a save is complete."
},
"beforeDisplayAction": {
"type": "string",
"description": "On GET - An action of this type is run after data is retrieved from the database just before it's sent to the template. It provides a spot where data can be unencrypted or updated before sending the data to the template for rendering."
},
"subflow": {
"type": "string",
"description": "For screens within a subflow, they need the name of the subflow defined."
},
"condition": {
"type": "string",
"description": "The name of a Condition whose run method will be executed to determine if this screen should be shown."
},
"callback": {
"type": "string",
"description": "A method name to run on callback."
}
}
}
}
},
"subflows": {
"type": "object",
"patternProperties": {
"^.*$": {
"type": "object",
"description": "Configuration for a given subflow. Identifies key screens within the subflow.",
"required": ["entryScreen", "iterationStartScreen", "reviewScreen", "deleteConfirmationScreen"],
"properties": {
"entryScreen": {
"type": "string",
"description": "The name of the subflows entry screen. This screen represents the entry point to a subflow, it is usually the point at which a user makes a decision to enter the subflow or not. Example: a screen that asks 'Would you like to add household members?' could be the entry screen for a household based subflow. This screen is used as the screen a user will be redirected to if they delete all iterations within a given subflow."
},
"iterationStartScreen": {
"type": "string",
"description": "The name of the subflows iteration start screen. This screen is the first screen in a subflows set of repeating screens. When this screen is submitted, it creates a new iteration which is then saved to the subflow array within the Submission object."
},
"reviewScreen": {
"type": "string",
"description": "The name of the review screen for this subflow. This is the last screen in a subflow. This screen lists each iteration completed within a subflow, and provides options to edit, delete or add a new iteration."
},
"deleteConfirmationScreen": {
"type": "string",
"description": "The name of the delete confirmation screen for this subflow. This screen appears when a user selects delete on a iteration listed on the review screen. It asks the user to confirm their deletion before submitting the actual deletion request to the server."
}
}
}
}
},
"landmarks": {
"type": "object",
"description": "Landmarks are a way to designate pages in a flow that have special meaning or significance to the flow.",
"properties": {
"firstScreen": {
"type": "string",
"description": "This landmark identifies the first screen in the flow. Put the first screen's name here."
}
}
}
}
}