5. User outputs
Requirements
- You have done the Wiring inputs and outputs tutorial
What you will learn
- Display downloadable results to users
What are they used for?
User outputs defines which files results that must be downloadable from the user.
These outputs will be then available at the end of the action user here:
And in Actions history panel:
Setup
User outputs are defined after the tasks
property, it's an object not an array:
json
{
"schema": "1.0",
"key": "my_first_job",
"title": "My first job",
"tasks": [],
"outputParameters": {}
}
1
2
3
4
5
6
7
2
3
4
5
6
7
Functionally we will enrich the Job Export excel like this:
Tasks
- Export Items Export items from a user selection
- Transform XSLT Transform items for the Generate Excel file
- Generate Excel Generate the Excel file
User outputs
- excel_files Output
files
of the task Generate the Excel file
In our previous example we have generated an Excel file, to display the result of the file generated you must set an output like below:
The updated result is:
json
{
"schema": "1.0",
"key": "my_first_job",
"title": "Export excel",
"icon": "file-excel",
"tasks": [
{
"name": "table-export-items",
"taskReferenceName": "table_export_items",
"description": "Export items from a user selection",
"optional": false,
"type": "SUB_WORKFLOW",
"inputParameters": {
"tableKey": "PL_DEMO_PRODUCTS",
"mode": "USER_SELECTION",
"fileName": "items.xml"
}
},
{
"name": "file-transformation-xslt",
"taskReferenceName": "file_transformation_xslt",
"description": "Transform items for the Generate Excel file",
"optional": false,
"type": "SUB_WORKFLOW",
"inputParameters": {
"mode": "FILE",
"file": "${table_export_items.output.file}",
"xslt": "file://assets/transform.xslt",
"fileName": "result.xml"
}
},
{
"name": "file-generation-xlsx",
"taskReferenceName": "file_generation_xlsx",
"description": "Generate the Excel file",
"optional": false,
"type": "SUB_WORKFLOW",
"inputParameters": {
"request": "${file_transformation_xslt.output.file}",
"templates": [
{
"key": "template-tutorial",
"file": "file://assets/template-tutorial.xlsx"
}
]
}
}
],
"outputParameters": {
"excel_files": "${file_generation_xlsx.output.files}"
}
}
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
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
You can use the name as you want for the key of the property. You can set multiple outputs parameters (each time a key and the value)
The value naming convention is: ${previous-taskReferenceName.output.valid-output}
Best practices
- For the property name, use lower case separated by
_
. - Always use the autocomplete of the vs code extension with
Ctrl + Space
.
What you have learned
You can configure what results can be downloadable at the end of a Job
Next
You will learn how to create User inputs