generated from OpenFn/project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.projectState.json
131 lines (131 loc) · 5.61 KB
/
.projectState.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
"id": "8d63dfa5-8ff3-436d-b9d1-58cb696ca00c",
"name": "unicef-supply",
"description": null,
"inserted_at": "2023-10-03T09:49:32",
"updated_at": "2024-04-13T08:50:04",
"scheduled_deletion": null,
"history_retention_period": null,
"dataclip_retention_period": null,
"requires_mfa": false,
"retention_policy": "retain_all",
"workflows": {
"SMT-Example": {
"id": "abfc68cf-f0f3-428b-9276-8c8b11d7af53",
"name": "SMT Example",
"inserted_at": "2023-10-03T09:50:37",
"updated_at": "2024-04-13T08:50:04",
"project_id": "8d63dfa5-8ff3-436d-b9d1-58cb696ca00c",
"deleted_at": null,
"edges": {
"cron->get-data-from-SMT": {
"enabled": true,
"id": "4a7d4951-a35a-45d7-ac00-ac29f01e0081",
"source_trigger_id": "7926f545-9112-4497-b2b7-e5a28425a00f",
"condition_type": "always",
"target_job_id": "83668659-3e63-475d-83ae-8354009540f3"
},
"get-data-from-SMT->build-and-map": {
"enabled": true,
"id": "e1f92d50-931d-4133-b30d-758789415c98",
"source_job_id": "83668659-3e63-475d-83ae-8354009540f3",
"condition_type": "on_job_success",
"target_job_id": "be666071-ede7-4a9d-9500-c4e109e4538e"
},
"build-and-map->load-to-dhis2": {
"enabled": true,
"id": "44a15cbb-6a1b-41c0-8a26-ecf570bbbacb",
"source_job_id": "be666071-ede7-4a9d-9500-c4e109e4538e",
"condition_type": "on_job_success",
"target_job_id": "9a6da1f1-198d-4f0e-b0b3-c8cbc2a033fa"
},
"build-and-map->handle-errors": {
"enabled": true,
"id": "870f7edd-e910-4b26-b8f7-9e56778ae2fc",
"source_job_id": "be666071-ede7-4a9d-9500-c4e109e4538e",
"condition_type": "on_job_failure",
"target_job_id": "c2969eb4-19ba-49f0-a943-8e541ac61d48"
},
"load-to-dhis2->finalize-on-SMT": {
"enabled": true,
"id": "cfe487cd-7890-43a8-a293-5ba392ce03f7",
"source_job_id": "9a6da1f1-198d-4f0e-b0b3-c8cbc2a033fa",
"condition_type": "on_job_success",
"target_job_id": "e8c61ef8-f9ce-429a-b29a-0f8903e363fd"
}
},
"jobs": {
"build-and-map": {
"id": "be666071-ede7-4a9d-9500-c4e109e4538e",
"name": "build and map",
"body": "fn(state => {\n const filteredData = state.data.map(x => {\n return {\n uid: x.id,\n title: `example only ${x.title}`,\n program: \"food-delivery-v3\",\n user: x.userId\n }\n })\n\n return { filteredData }\n});\n",
"adaptor": "@openfn/language-ocl@latest"
},
"get-data-from-SMT": {
"id": "83668659-3e63-475d-83ae-8354009540f3",
"name": "get data from SMT",
"body": "// get data from the SMT\nget('posts');\n\n// drop everything else, only pluck out what we need\nfn(state => {\n const stuffWeWant = state.data.slice(0, 10);\n return { data: stuffWeWant }\n});\n",
"adaptor": "@openfn/language-http@latest"
},
"load-to-dhis2": {
"id": "9a6da1f1-198d-4f0e-b0b3-c8cbc2a033fa",
"name": "load to dhis2",
"body": "create('dataValueSets', {\n completeDate: '2014-02-03',\n period: '201401',\n orgUnit: \"dWOAzMcK2Wt\", /*Alkalia CHP*/\n dataValues: state.filteredData.map(x => ({\n dataElement: 'f7n9E0hX8qk',\n value: x.user,\n }))\n});\n",
"adaptor": "@openfn/language-dhis2@latest"
},
"handle-errors": {
"id": "c2969eb4-19ba-49f0-a943-8e541ac61d48",
"name": "handle errors",
"body": "post('https://jsonplaceholder.typicode.com/posts', {\n body: {\n \"userId\": 1,\n \"title\": \"The sync to DHIS2 just failed.\",\n \"body\": \"This failed!\"\n }\n});\n",
"adaptor": "@openfn/language-http@latest"
},
"finalize-on-SMT": {
"id": "e8c61ef8-f9ce-429a-b29a-0f8903e363fd",
"name": "finalize on SMT",
"body": "fn(state => {\n state.testing = 42;\n console.log('DHIS2 says', JSON.stringify(state.data.response, null, 2));\n return state;\n})\n\npost('posts', {\n body: {\n \"userId\": 1,\n \"title\": \"Everything worked, here's the updated data\",\n \"body\": state.data\n }\n});\n",
"adaptor": "@openfn/language-http@latest"
}
},
"triggers": {
"cron": {
"enabled": false,
"id": "7926f545-9112-4497-b2b7-e5a28425a00f",
"type": "cron",
"cron_expression": "15 * * * *"
}
}
},
"Select-from-DB": {
"id": "a31b0062-2ad2-45dd-9451-81d2fcf3c2d3",
"name": "Select from DB",
"inserted_at": "2023-11-22T08:32:10",
"updated_at": "2024-04-13T08:50:04",
"project_id": "8d63dfa5-8ff3-436d-b9d1-58cb696ca00c",
"deleted_at": null,
"edges": {
"webhook->Get-food-hygiene-data": {
"enabled": true,
"id": "f601cacd-c5c3-497c-b861-6b8fd1ba9771",
"source_trigger_id": "97160bcb-c62a-4ae6-b37b-e75718f82acc",
"condition_type": "always",
"target_job_id": "c525a5ae-b88d-43c9-aeec-510275e39f35"
}
},
"jobs": {
"Get-food-hygiene-data": {
"id": "c525a5ae-b88d-43c9-aeec-510275e39f35",
"name": "Get food hygiene data",
"body": "sql(state => `select * from food_hygiene_interview`);\n",
"adaptor": "@openfn/language-postgresql@latest"
}
},
"triggers": {
"webhook": {
"enabled": false,
"id": "97160bcb-c62a-4ae6-b37b-e75718f82acc",
"type": "webhook"
}
}
}
}
}