|
37 | 37 | "userProperties": [], |
38 | 38 | "typeProperties": { |
39 | 39 | "expression": { |
40 | | - "value": "@less(activity('Process Batch').output.runStatus.metrics.instanceTable.rowsWritten, pipeline().parameters.BatchSize)", |
| 40 | + "value": "@not(variables('Continue'))", |
41 | 41 | "type": "Expression" |
42 | 42 | }, |
43 | 43 | "activities": [ |
|
120 | 120 | } |
121 | 121 | }, |
122 | 122 | { |
123 | | - "name": "Add Limit to Offset", |
124 | | - "description": "Add the limit to the current offset.", |
125 | | - "type": "SetVariable", |
| 123 | + "name": "Determine Continuation", |
| 124 | + "description": "Check the previous activity for metrics related to the instance table sink to determine whether processing should continue.", |
| 125 | + "type": "IfCondition", |
126 | 126 | "dependsOn": [ |
127 | 127 | { |
128 | 128 | "activity": "Process Batch", |
129 | 129 | "dependencyConditions": [ "Succeeded" ] |
130 | 130 | } |
131 | 131 | ], |
132 | | - "policy": { |
133 | | - "retry": 0, |
134 | | - "retryIntervalInSeconds": 30, |
135 | | - "secureOutput": false, |
136 | | - "secureInput": false |
137 | | - }, |
138 | 132 | "userProperties": [], |
139 | 133 | "typeProperties": { |
140 | | - "variableName": "Temp", |
141 | | - "value": { |
142 | | - "value": "@string(add(int(variables('CurrentOffset')), pipeline().parameters.BatchSize))", |
| 134 | + "expression": { |
| 135 | + "value": "@contains(activity('Process Batch').output.runStatus.metrics, 'instanceTable')", |
143 | 136 | "type": "Expression" |
144 | | - } |
| 137 | + }, |
| 138 | + "ifFalseActivities": [ |
| 139 | + { |
| 140 | + "name": "Complete Processing", |
| 141 | + "description": "Signal that processing should stop because there are no more changes.", |
| 142 | + "type": "SetVariable", |
| 143 | + "dependsOn": [], |
| 144 | + "policy": { |
| 145 | + "timeout": "0.12:00:00", |
| 146 | + "retry": 0, |
| 147 | + "retryIntervalInSeconds": 30, |
| 148 | + "secureOutput": false, |
| 149 | + "secureInput": false |
| 150 | + }, |
| 151 | + "userProperties": [], |
| 152 | + "typeProperties": { |
| 153 | + "variableName": "Continue", |
| 154 | + "value": { |
| 155 | + "value": "@bool('false')", |
| 156 | + "type": "Expression" |
| 157 | + } |
| 158 | + } |
| 159 | + } |
| 160 | + ], |
| 161 | + "ifTrueActivities": [ |
| 162 | + { |
| 163 | + "name": "Check Rows", |
| 164 | + "description": "Update the continuation variable based on the number of rows processed in the last batch.", |
| 165 | + "type": "SetVariable", |
| 166 | + "dependsOn": [], |
| 167 | + "policy": { |
| 168 | + "timeout": "0.12:00:00", |
| 169 | + "retry": 0, |
| 170 | + "retryIntervalInSeconds": 30, |
| 171 | + "secureOutput": false, |
| 172 | + "secureInput": false |
| 173 | + }, |
| 174 | + "userProperties": [], |
| 175 | + "typeProperties": { |
| 176 | + "variableName": "Continue", |
| 177 | + "value": { |
| 178 | + "value": "@greater(activity('Process Batch').output.runStatus.metrics.instanceTable.rowsWritten, 0)", |
| 179 | + "type": "Expression" |
| 180 | + } |
| 181 | + } |
| 182 | + }, |
| 183 | + { |
| 184 | + "name": "Add Limit to Offset", |
| 185 | + "description": "Add the limit to the current offset.", |
| 186 | + "type": "SetVariable", |
| 187 | + "dependsOn": [ |
| 188 | + { |
| 189 | + "activity": "Check Rows", |
| 190 | + "dependencyConditions": [ "Succeeded" ] |
| 191 | + } |
| 192 | + ], |
| 193 | + "policy": { |
| 194 | + "timeout": "0.12:00:00", |
| 195 | + "retry": 0, |
| 196 | + "retryIntervalInSeconds": 30, |
| 197 | + "secureOutput": false, |
| 198 | + "secureInput": false |
| 199 | + }, |
| 200 | + "userProperties": [], |
| 201 | + "typeProperties": { |
| 202 | + "variableName": "Temp", |
| 203 | + "value": { |
| 204 | + "value": "@string(add(int(variables('CurrentOffset')), pipeline().parameters.BatchSize))", |
| 205 | + "type": "Expression" |
| 206 | + } |
| 207 | + } |
| 208 | + }, |
| 209 | + { |
| 210 | + "name": "Update Offset", |
| 211 | + "description": "Update the current offset based on the newly computed value.", |
| 212 | + "type": "SetVariable", |
| 213 | + "dependsOn": [ |
| 214 | + { |
| 215 | + "activity": "Add Limit to Offset", |
| 216 | + "dependencyConditions": [ "Succeeded" ] |
| 217 | + } |
| 218 | + ], |
| 219 | + "policy": { |
| 220 | + "timeout": "0.12:00:00", |
| 221 | + "retry": 0, |
| 222 | + "retryIntervalInSeconds": 30, |
| 223 | + "secureOutput": false, |
| 224 | + "secureInput": false |
| 225 | + }, |
| 226 | + "userProperties": [], |
| 227 | + "typeProperties": { |
| 228 | + "variableName": "CurrentOffset", |
| 229 | + "value": { |
| 230 | + "value": "@variables('Temp')", |
| 231 | + "type": "Expression" |
| 232 | + } |
| 233 | + } |
| 234 | + } |
| 235 | + ] |
145 | 236 | } |
146 | 237 | }, |
147 | 238 | { |
148 | | - "name": "Update Offset", |
149 | | - "description": "Update the current offset based on the newly computed value.", |
| 239 | + "name": "Cancel Processing", |
| 240 | + "description": "Signal that processing should stop because there was a problem processing a batch.", |
150 | 241 | "type": "SetVariable", |
151 | 242 | "dependsOn": [ |
152 | 243 | { |
153 | | - "activity": "Add Limit to Offset", |
154 | | - "dependencyConditions": [ "Succeeded" ] |
| 244 | + "activity": "Process Batch", |
| 245 | + "dependencyConditions": [ "Failed" ] |
155 | 246 | } |
156 | 247 | ], |
157 | 248 | "policy": { |
| 249 | + "timeout": "0.12:00:00", |
158 | 250 | "retry": 0, |
159 | 251 | "retryIntervalInSeconds": 30, |
160 | 252 | "secureOutput": false, |
161 | 253 | "secureInput": false |
162 | 254 | }, |
163 | 255 | "userProperties": [], |
164 | 256 | "typeProperties": { |
165 | | - "variableName": "CurrentOffset", |
| 257 | + "variableName": "Continue", |
166 | 258 | "value": { |
167 | | - "value": "@variables('Temp')", |
| 259 | + "value": "@bool('false')", |
168 | 260 | "type": "Expression" |
169 | 261 | } |
170 | 262 | } |
|
224 | 316 | "Temp": { |
225 | 317 | "type": "String", |
226 | 318 | "defaultValue": "0" |
| 319 | + }, |
| 320 | + "Continue": { |
| 321 | + "type": "Boolean", |
| 322 | + "defaultValue": false |
227 | 323 | } |
228 | 324 | }, |
229 | 325 | "annotations": [], |
230 | | - "lastPublishTime": "2023-06-21T23:36:59Z" |
| 326 | + "lastPublishTime": "2023-06-23T19:54:06Z" |
231 | 327 | }, |
232 | 328 | "dependsOn": [ "[concat(variables('factoryId'), '/dataflows/Update DICOM Delta Tables')]" ] |
233 | 329 | }, |
|
0 commit comments