Previous Topic: Invisible Parameter OptionNext Topic: Test the Custom Operator Interface


Expand Macro in the Value Property

To use a custom parameter to define the value of a base operator parameter (a typical reason for using custom parameters), you must treat it as a macro. Use the Expand macro in the value property to permit user input for a custom operator field to be used as the value for the base operator parameter.

To do this, set the Hidden property first. Then configure the base operator parameter with the Expand macro in the value option. CA Process Automation searches the base operator parameter values (for any parameter with the Expand macro in the value set) for any custom parameter name, and replaces the custom parameter name with the customer parameter value. While this is a powerful feature, take care to determine which base operator parameters should have the Expand macro in the value option set and in naming your custom parameters so that they are unique enough that you do not accidentally replace a string with your custom parameter sharing the same name.

For example, you created a custom operator using the Run Script operator as a base. The script is defined to pass some parameters based on input supplied by a user of the custom operator. A form field is added to obtain this input from the end user and that field is named for. In the base operator, add one parameter and enter the value for and set the Expand macro in the value property to true. This correctly passes the user's input configured in the custom operator form field to the script as a parameter.

If a user enters the value Steve for this custom parameter, the script would receive one parameter with the value Steve. However, if you set the Expand macro in the value property for the base operator parameter inLineScript, this replaces the word for anywhere in the script with the word Steve. This is undesirable, as the scripting code for any For loops would be accidentally replaced with an unintended term, resulting in a syntax error in your script.

More information:

Custom Operator: Properties Tab