EXEC VARA Objects
Use EXEC VARA objects as intermediaries that read and pass on the values returned by other executable objects. These values may affect the subsequent execution of objects or trigger the execution of objects. You store the readouts in the script variables that are defined in the EXEC VARA object. The VARA object itself has no input parameters.
This page includes the following:
Prerequisites
The names of the parameters in the EXEC VARA object and in the PromptSet of the executable object that supplies the return codes must be identical.
PromptSet variables are supported in select fields for BACKEND, EXEC, FILELIST, SEC_SQLI, SEC_SQL, SQLI, SQL, and XML variable types. Using PromptSet variables is necessary when using the Dynamic Reload (Combobox Prompts) feature.
Defining EXEC VARA Objects
An EXEC VARA object definition is made up of the following pages:
- General Page
-
Variables
Here you define the object-specific settings. Some sections on this page are common to all VARA objects and are described for all of them in dedicated topics:
- Variable Settings, see below
- Parameters
- Data Types and Formatting
- Script Access
- Client 0 VARA Objects in Other Clients
- Preview, see below
- Version Management Page
- Documentation Page
Variable Settings Section
-
Type
Read-only. You determine the variable type when you create the object. It cannot be changed once the variable is defined.
-
Executable object
Name of the Automation Engine executable object from which this EXEC VARA object reads the values. Type it or click the icon to open a dialog and search for it.
Warning! Schedule objects should not be used with EXEC VARA objects.
-
Result variable
The name of the script variable that is used for the return value of the executable object.
List of parameters and variables that are available in the executable object. Their values can be either:
- Direct values, for example 5342
-
Reference variables, for example &reftext#.
Trailing spaces at the end of values are removed when saving EXEC Variables.
You can include PromptSet variables here when using the Dynamic Reload (Combobox Prompts) feature for Combobox prompts. When you use PromptSet variables in a dynamic VARA object, the Preview feature returns an error. This is because the PromptSet variables do not exist in the dynamic VARA object. However, the PromptSet variables will be resolved when objects including the PromptSet are executed.
Treat these parameters as though they were PromptSet/read buffer values. When a VARA object calls the executable object, it uses :PUT_PROMPT_BUFFER to set the specified parameters. To read and use these values in the called executable object, you must use the :READ command. This command reads in the values of variables of the same names. The values depend on the parameters that are set in the calling EXEC Variable object.
Important! It is not sufficient merely to define the variables on the Variables page under Variables & Prompts for the called executable object.
For more information, see :PUT_READ_BUFFER, :PUT_PROMPT_BUFFER.
Preview
To preview the variable, click Preview. A preview of the result values stored or transferred is displayed.
Examples:
Using an EXEC Variable in a Precondition
To use an EXEC variable in a precondition, do the following:
- In an executable object, include code like the following:
- Create an EXEC variable and point it the executable object.
- Access the EXEC variable in either a:
- Script with the following code, :SET &TEST# = GET_VAR (VARA.EXEC)
- Prompt or precondition with, {VARA.EXEC}
:SET &RET# = "Y"
Using an EXEC Variable As a Data Sequence
If you want to use an EXEC variable to pass a list of values (e.g. for using the result in a PromptSet dropdown):
- You can use data sequences for this purpose (:CREATE_PROCESS, ....).
- The first line is always a header line.
- You have to return the saved data sequence with SAVE_PROCESS().
- The process must be saved directly in the object that is used for EXEC variable (Workflows with JOBS and JOBS created that saved and published the data sequence do not work).
In an executable object, in order to return a list of values, include something like the following:
:SET &HND# = CREATE_PROCESS(NEW)
! add the header line
:SET &CHECK# = PUT_PROCESS_LINE(&HND#, "Header A;Header B; Header C", ";")
!fill the process with another one!
:PROCESS &HND_SOURCE#
: SET &CHECK# = PUT_PROCESS_LINE(&HND#, "Value1;Value 2; Value 3", ";")
:ENDPROCESS
! save process
:SET &RET# = SAVE_PROCESS(&HND#)
:PUBLISH &RET#,,TOP
:CLOSE_PROCESS(&HND#)
In the VARA.EXEC the executable object, point to the object with the content about. The return value would be set to &RET#.
See also: