Skip to content

Commit 98730a7

Browse files
committed
Fix until condition
1 parent 821f4dd commit 98730a7

File tree

2 files changed

+118
-22
lines changed

2 files changed

+118
-22
lines changed

templates/Copy DICOM Metadata Changes to ADLS Gen2 in Delta Format/Copy DICOM Metadata Changes to ADLS Gen2 in Delta Format.json

Lines changed: 117 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"userProperties": [],
3838
"typeProperties": {
3939
"expression": {
40-
"value": "@less(activity('Process Batch').output.runStatus.metrics.instanceTable.rowsWritten, pipeline().parameters.BatchSize)",
40+
"value": "@not(variables('Continue'))",
4141
"type": "Expression"
4242
},
4343
"activities": [
@@ -120,51 +120,143 @@
120120
}
121121
},
122122
{
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",
126126
"dependsOn": [
127127
{
128128
"activity": "Process Batch",
129129
"dependencyConditions": [ "Succeeded" ]
130130
}
131131
],
132-
"policy": {
133-
"retry": 0,
134-
"retryIntervalInSeconds": 30,
135-
"secureOutput": false,
136-
"secureInput": false
137-
},
138132
"userProperties": [],
139133
"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')",
143136
"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+
]
145236
}
146237
},
147238
{
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.",
150241
"type": "SetVariable",
151242
"dependsOn": [
152243
{
153-
"activity": "Add Limit to Offset",
154-
"dependencyConditions": [ "Succeeded" ]
244+
"activity": "Process Batch",
245+
"dependencyConditions": [ "Failed" ]
155246
}
156247
],
157248
"policy": {
249+
"timeout": "0.12:00:00",
158250
"retry": 0,
159251
"retryIntervalInSeconds": 30,
160252
"secureOutput": false,
161253
"secureInput": false
162254
},
163255
"userProperties": [],
164256
"typeProperties": {
165-
"variableName": "CurrentOffset",
257+
"variableName": "Continue",
166258
"value": {
167-
"value": "@variables('Temp')",
259+
"value": "@bool('false')",
168260
"type": "Expression"
169261
}
170262
}
@@ -224,10 +316,14 @@
224316
"Temp": {
225317
"type": "String",
226318
"defaultValue": "0"
319+
},
320+
"Continue": {
321+
"type": "Boolean",
322+
"defaultValue": false
227323
}
228324
},
229325
"annotations": [],
230-
"lastPublishTime": "2023-06-21T23:36:59Z"
326+
"lastPublishTime": "2023-06-23T19:54:06Z"
231327
},
232328
"dependsOn": [ "[concat(variables('factoryId'), '/dataflows/Update DICOM Delta Tables')]" ]
233329
},

0 commit comments

Comments
 (0)