Decision
A decision task is similar to case...switch statement in a programming language.
Json
Example
json
{
"name": "decision",
"taskReferenceName": "decision",
"description": "Handle the case where no file have been recovered from the FTP Get task.",
"inputParameters": {
"noFile": "${ftp_get.output.noFile}"
},
"type": "DECISION",
"caseValueParam": "noFile",
"defaultCase": [],
"decisionCases": {
"YES": [],
"NO": []
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
json
{
"schema": "1.0",
"key": "recover_csv_products_file_from_ftp",
"title": "Recover csv products file from ftp",
"tasks": [
{
"name": "protocol-ftp-get",
"taskReferenceName": "ftp_get",
"description": "Recover the csv file from the FTP",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"connection": "SFTP",
"host": "********",
"username": "********",
"password": "********",
"port": 21,
"mode": "PARAMETERS",
"remoteFolder": "/",
"sort": "LAST_MODIFIED_DESC",
"filter": "products.csv",
"maxFiles": 1
}
},
{
"name": "decision",
"taskReferenceName": "decision",
"description": "Handle the case where no file have been recovered from the FTP Get task.",
"inputParameters": {
"noFile": "${ftp_get.output.noFile}"
},
"type": "DECISION",
"caseValueParam": "noFile",
"decisionCases": {
"YES": [
{
"name": "notification-send-email",
"taskReferenceName": "send_email",
"description": "Send an email to an administrator to indicate that there is no file to recover from the FTP",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"mode": "FILE",
"file": ""
}
},
{
"name": "terminate",
"taskReferenceName": "terminate",
"description": "Terminate the job in success",
"inputParameters": {
"terminationStatus": "COMPLETED"
},
"type": "TERMINATE"
}
],
"NO": [
{
"name": "file-conversion-csv-to-xml",
"taskReferenceName": "csv_to_xml",
"description": "Transform file from csv to xml",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"mode": "FILE",
"file": "${ftp_get.output.file}",
"columnSeparator": ";",
"textDelimiter": "\"",
"escapeCharacter": "\""
}
},
{
"name": "file-transformation-xslt",
"taskReferenceName": "transform_xslt",
"description": "Transform xml to Product-Live items XML format",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"mode": "FILE",
"file": "${csv_to_xml.output.file}",
"xslt": "file://assets/transform.xslt",
"fileName": "result.xml"
}
},
{
"name": "table-import-items",
"taskReferenceName": "import_items",
"description": "Import products",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"request": "${transform_xslt.output.file}"
}
}
]
}
}
]
}
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
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
Definition
Property | Description |
---|---|
name | The name of the task, must be: decision |
taskReferenceName | The unique name of the task in your job. |
description | The functional description of this task in your job. |
type | Set DECISION for this task. |
optional | true : the job continues if there is an error on this task. false : the job fails. |
inputParameters | For the decision task you must define a key with the output of a previous task. The output must be an . Best practice: use the name of the output parameter for the property key. |
caseValueParam | You must use the name of the parameter in task input whose value will be used as a switch. |
defaultCase | optional List of tasks to be executed when no matching value if found in decision case (default condition). |
decisionCases | Map where key is possible values of caseValueParam with value being list of tasks to be executed. |
Outputs
This task does not have outputs.
Limits and additional notes
- 10 conditions
FAQ
Which values must be used for the decisionCases
Most of the other task have output values with type ENUM. You must use one of the values. For example the task FTP Get has the output noFile
of type ENUM and with the values YES
| NO
. See the documentation of output parameters for each task.