@ -6,10 +6,18 @@ Parameters configured on the task definition page, the scope of this parameter i
## Usage
* If you want to use parameter in single task, see [local parameter with custom parameter](#use-local-parameter-by-custom-parameter)
* If you want to use set parameter in task and use them in downstream tasks:
* For simple use without using custom parameter, see [export parameter via `setValue`](#export-local-parameter-by-setvalue)
* Using custom parameter, see [export parameter via `setValue` and custom parameter](#export-local-parameter-by-setvalue-and-custom-parameter)
* Using bash variable, see [export parameter via `setValue` and bash variable](#export-local-parameter-by-setvalue-and-bash-variable)
Usage of local parameters is: at the task define page, click the '+' beside the 'Custom Parameters' and fill in the key and value to save.
## Examples
### Use Local Parameter by Custom Parameter
This example shows how to use local parameters to print the current date. Create a Shell task and write a script with the content `echo ${dt}`. Click **custom parameter** in the configuration bar, and the configuration is as follows:
> Note: The local parameter can be used in the workflow of the current task node. If it is set to OUT, it can be passed to the downstream workflow. Please refer to: [Parameter Context](context.md)
### Export Local Parameter by `setValue`
If you want to simple export parameters and then use them in downstream tasks, you could use `setValue` in your task, which
you can manage your parameters into one single task. You can use syntax `echo '${setValue(set_val=123)}'`(**do not forget the
single quote**) in Shell task and add new `OUT` custom parameter to export it.
If you want to export parameters with bash variable instead of constants value, and then use them in downstream tasks, you could use `setValue` in your task, which more flexible such as you can get variable for exists local or HTTP resource. You can use syntax like