Data Factory > Decision Task β
This tasks is deprecated
This tasks is deprecated and will be removed in the future. Please use the Switch Task instead.
TL;DR;
This task allows you to make decisions inside a Data Factory Job based on the value of a variable.
Name:
Type:
Target β
Allow the execution of tasks under certain conditions.
TIP
This "system" task is a direct borrowing from a feature of the conductor tool (the tool underlying Data Factory). More information on how the decision task of conductor works here.
Example of use in a job β
- Retrieve a product file, but if the file is not present, do not cause the job to start in error
1. FTP Get Get the last file that ends with -items.xml
2. Decision test on the output noFile property of the FTP Get task
has. Case noFile = YES
i. Send Email Send an email to the FTP manager to notify him of the problem
ii. Terminate Task Successfully complete task
b. Case noFile = NO
i. Import Items Import Products1
2
3
4
5
6
7
2
3
4
5
6
7
Inputs / Outputs β
Example of definition of this task
json
{
"name": "decision",
"taskReferenceName": "decision",
"description": "Are all items valid?",
"type": "DECISION",
"inputParameters": {
"case_value_param": "${file_transformation_xslt.output.allFilesTransformed}"
},
"caseValueParam": "case_value_param",
"decisionCases": {
"YES": [{
"name": "notification-display-message",
"taskReferenceName": "display_message_valid",
"description": "Display the message 'no items have been sent' to user",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"request": "file://assets/valid_items_message.html",
"height": 155
}
}
]
},
"defaultCase": [{
"name": "notification-display-message",
"taskReferenceName": "display_message_unvalid",
"description": "Display the message 'no items have been sent' to user",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"request": "file://assets/unvalid_items_message.html",
"height": 155
}
}, {
"name": "terminate",
"taskReferenceName": "terminate",
"description": "Terminate the job in error",
"type": "TERMINATE",
"optional": false,
"inputParameters": {
"terminationStatus": "FAILED",
"outputParameters": {
"message": "${display_message_unvalid.output.message}"
}
}
}
]
}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
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
WARNING
The type to use for a decision task is always DECISION
Inputs
| Property | Description |
|---|---|
caseValueParam | Required - String The name of the parameter that will be used to perform the "switch" |
decisionCases | Mandatory - Map of Tasks The key of the map corresponds to the value of the parameter mentioned in caseValueParam. (See example above) |
defaultCase | Mandatory - Array of Task The list of tasks to be executed if the value of the parameter mentioned in caseValueParam is not covered by the cases mentioned in decisionCases |
Outputs β
| Property | Description |
|---|---|
caseOutput | Array of String The list of "matched" cases in decisionCases |