Parameters
Use parameters in flows to set values for stage properties at run time. You can change parameter values for each job run without editing the flow, making your flows easier to manage and reuse.
To use parameters, create a parameter set for the project. A parameter set groups multiple parameters that you can reuse across flows in the same project. When you configure a flow, add the parameter set to the flow, and then reference the parameters in stage properties.
You can define a default value for each parameter, and then override the default value for each
job or job run started from the flow. For example, you might create a
directory parameter with a default value that points to a production directory.
During testing, you can override the value to point to a test directory.
To use parameters, complete the following tasks:
Creating a parameter set
Create a parameter set to define a group of parameters that you can reuse across flows in the same project.
About this task
- Support string parameters only.
- Do not support double underscores (__) in a parameter set name.
- Do not support environment variables.
- Do not support value sets.
If a parameter set includes other parameter types, environment variables, or value sets, StreamSets flows disable those elements in the parameter set.
Procedure
Results
Adding a parameter set to a flow
Add a parameter set to each flow where you want to use the parameters.
Procedure
- In the flow canvas, click the Add parameters icon {#}.
- Click Add parameter set.
- Select the parameter sets that you want to use, and then click Add.
- Click Return to canvas.
Using parameters in a flow
After you add a parameter set to a flow, you can use the parameters in stage properties.
Procedure
Defining parameter values for a job
After you add parameters to a flow, define the parameter values for the job and job runs that start from this flow.
About this task
You define job parameter values in the flow settings. You can allow users to override these values each time they start a job run from the flow canvas.
You cannot override parameter values when you start a job run from the job details page. Subsequent runs from the job details page always use the job parameter values defined in the flow settings.
Procedure
- In the flow canvas, click the Settings icon.
- On the Flow settings page, click the Runtime parameters tab.
- Enter the job parameter values. Override default values as needed.
- To allow overriding parameter values each time you start a job run from the flow canvas, select Prompt before running a flow.
- Click Save.