Working With Parameters

Parameters provide a way to replace specific values at run time. For example, a path identifying the location of a program object file (that is, an .exe file) could be set up as a Parameter. If the path changes, then you can simply change the Parameter's value without having to change each Operation that uses the path. You can create Parameters and use them when configuring Operations and Dependencies.

For example: the following Operation run command has @Path as one of its parameters.  

isql /S@Server /U@User /P@password /I @Path/file.sql

The above run command has four parameters: @Server, @User, @Password, and @Path. After the Parameters are replaced by the Executive Server, the Operation run command might look like:

isql /SMyServer /Usa /uPnknown /I c:\sql\file.sql

Note:  It is recommended that the Parameter name start with a character such as the ampersand-'@'. This helps eliminate unintended parameter substitution.

Parameter Groups

For efficiency purposes, Parameters can be combined into Parameter Groups. The Parameter Group field on the Job or Operation Update window can be one of the following values: <none>, <all>, or a user defined Parameter Group. If an object does not use Parameters, select the <none> option. If an object does use Parameters and you want all Parameters configured within SmartBatch to be searched for replacement values, specify a Parameter Group of <all>. However, if you have a large number of Parameters configured, you can reduce the amount of processing by combining Parameters into user defined Parameter Groups. If a specific Parameter Group is then identified for an object, the Executive Server limits its search to only the Parameters within that Parameter Group.

Parameter Inheritance

As Parameter Groups can be specified at the Job or Operation level, it is importance to understand the inheritance properties of Parameters. If any level uses the <all> Parameter Group option, then all Parameters are used and applied to the Operation one time. Otherwise, if user defined Parameter Groups are specified, the Parameter Group at the Operation level is applied first, then the Parameter Group at the Job level. This allows and Operations to inherit Parameter values from  Jobs.

Reserved Parameters

SmartBatch supports user defined Parameters as shown in the example above with @Path. However, there are some Parameters reserved for SmartBatch. There are two categories of reserved Parameters: object name Parameters and date/time Parameters. If you opt to use any of the reserved Parameters, you configure them on the Parameter Update window just like you would a user defined Parameter. However, you must use their correct names and apply the correct Param Values.

Adding and Updating Parameters

You maintain Parameters on the Parameter Update window.

Listing Parameters

Clicking on the Parameters node in the tree view shows a list of Parameters for the current application in the right list view pane.  Right-click on an Parameter listed in the right list view pane to display available menu items.  

Custom Parameter Capability

SmartBatch provides a way to implement custom formatting and value resolution using a .NET assembly.  The assembly OnLineToolWorks.Application.Parameters is defined in the Global Assembly Cache (GAC).  The source code is provided so that you can see how it is implemented and can extend the functionality if desired.  The .NET project is installed into the <InstallDirectory>\Samples\Parameters.  For implementation details load the provided project into the Visual Studio .NET design environment.