Customizing Workflows With Parameters
Last updated
Last updated
© Copyright 2023, Astera Software
The workflows you create with Astera can be ported to any number of target environments that may use different connections to data providers, or other settings specific to the target environment. For example, you can create and test your workflow in a staging environment, and then deploy it in your production environment.
Prior to deploying to your target environment, you may need to update the workflow’s data connections, making them appropriate for the target environment. The updating of data connections is made easy by using the Parameter Information Replacement dialog.
To open the Parameter Information Replacement dialog, click the icon on the Workflow toolbar.
The left-hand pane of the Parameter Information Replacement dialog shows the Parameter tree with the objects that support the use of parameters, present in the workflow.
Objects in the tree can be grouped by category, such as Source, Workflow Tasks, etc, or left ungrouped. The grouping is done by means of the two icons in the top left of the dialog.
Note: In the case of a scheduled workflow running on a server, a similar functionality is available in the Job Parameters tab of the scheduled job interface in the Scheduler.
In addition to aligning your data connections with a target environment, you might also want to ensure that any context information is suitable for the environment in which your workflow will run. For example, make sure that the server’s name variable points to the correct server instead of being hard-coded.
This can be achieved by using Context Information parameters. Context Information parameters take their values dynamically at workflow run-time. These parameters include ServerName, JobId, UserName, DroppedFilePath, and others.
To use Context Information parameters in your workflow, drag and drop the Context Information object from the Resources group in the Toolbox onto the workflow.
An example of what a Context Information object might look like is shown below.
The following parameters are available:
Name: Name of the workflow.
JobId: ID of the job assigned by the server.
ScheduledJobId: ID of the job associated with a schedule in case of scheduled running on a server.
ServerName: Name of the server running the workflow.
UserName: User account that runs the workflow.
DroppedFilePath: Path to the file being dropped, in case of a scheduled job of type when file is dropped.
SubmissionID: Provides the ID of the user performing the submission.
You can also define any number of custom parameters. These custom parameters can be used throughout the workflow. They can be initially assigned a default value, and then their value can change while running your workflow.
Custom parameters can be configured in the Variables object. To add a Variables object in a workflow, drag it from the Resources group in the Toolbox and drop it onto the workflow.
An example of what a Parameters object might look like is shown below.
To add a new parameter, open the Parameters object properties and enter your new parameter in the grid. The parameter should be assigned a data type, and it can be optionally assigned a default value.
You can also refer to most objects’ property values by using the $ (dollar-sign) notation, such as $object_name.field_name. This functionality is available in any area in the workflow that accepts $ parameters.
Examples of workflow areas that accept $ parameters are:
Run SQL Script task
Parameter Information Replacement dialog
Send Mail task
Below is an example of using a $ parameter in a Run SQL Script object:
"SELECT [dbo].[Customers].[CustomerID],
[dbo].[Customers].[CompanyName],
[dbo].[Customers].[ContactName],
[dbo].[Customers].[ContactTitle]
FROM [dbo].[Customers]
where CustomerId = ‘$(SQLQuerySource1.CustomerID)"