Inputting and Outputting Data from Automations
Introduction
You can define input and output parameters on Automation level. Doing so allows you, and other automation developers, to use an Automation in other Automations as a black-box component, passing input and receiving the expected output through parameters, just like with an ActionTask.
The Automations’s parameters fall into two categories:
- Input—Input parameters are values entering the Automation from an outside source. This can be a preceding Automation model component when using the Automation as a sub-Automation or a form on a Wiki page.
- Output—You can use the Automation’s output parameters to pass values to the succeeding Automation model components when using the Automation as a sub-Automation.
In the Automation context, input and output parameters are stored in the PARAMS map. This map is only available in the Automation’s scope.
If you run the Automation as a sub-Automation, you can choose where the Automation’s End task writes the output parameters: DEFAULT writes to the parent Automation’s OUTPUTS map, FLOWS writes to the FLOWS map, and WSDATA writes to the WSDATA map. Make your selection when configuring the sub-Automation’s properties in the Automation Designer.
The best practice is to define all your input and output parameters when designing the Automation. Creating them in the Automation’s code is not recommended.
To learn more about passing values in and out of Automations and ActionsTasks, see ActionTask Development and Programming the Automation Model.
Managing Automation Parameters
Take these steps to add, remove, or modify an Automation parameter:
- Create an Automation or open an existing one.
- Go to the Automation tab and then to the Params sub-tab.
- Click the tab corresponding to the type of parameter that you are managing:
- Input for input parameters.
- Output for output parameters.
- Use the toolbar buttons to manage parameters as follows:
- To create a parameter, click Add and then fill in the details in the lower pane that appears.
See below the procedure for an explanation of the available fields. - To delete a parameter from the Automation, select it in the list and then click Remove.
- To modify a parameter, select it in the list and then edit its details in the lower pane that appears.
- To create a parameter, click Add and then fill in the details in the lower pane that appears.
See Field Reference for an explanation of the available fields.
Field Reference
The Params sub-tab of an Automation contains the following fields:
- Name—Enter a name for the parameter.
Allowed characters are letters, numbers, and underscore. The name must start with a letter. - Display Name—Reserved for future use.
- Type—Select the parameter type. It can be String, Int (integer), Decimal, Date, or Encrypted.
- Source—Select where the parameter’s value will come from.
CONSTANT
—Allows you to set the value to a literal depending on the Type.WSDATA
,PROPERTY
,FLOW
,PARAM
—Select one of these maps and then enter a variable name from the map to use as a source for the parameter.- Input parameters can be sourced from all these maps.
- Output parameters can be sourced only from
FLOW
orWSDATA
.
- Value—Value for the parameter:
- If the Source is
CONSTANT
, this is a literal that cannot be changed anymore by manipulating thePARAMS
maps, even when the value is empty. If you leave the value empty, the parameter will be completely missing from the parameter map. - If the Source is
WSDATA
,PROPERTY
,FLOW
, orPARAM
, this is a variable name present in the respective map. - If you don’t enter a value, you can do so later when nesting the Automation in another Automation model or when running the Automation indirectly (like from Scheduled jobs). note
Some of the methods for running Automations, such as Scheduled Jobs, ignore the default value and require you to enter a value explicitly.
- If the Source is
- Tooltip—Reserved for future use.
- Hidden—Check to hide the parameter from users who run the Automation. Some information, like passwords saved in
PROPERTY
variables, should be kept hidden.