EXEC Variables
The dynamic variable EXEC can be used as an intermediary, carrying out a readout of return values of executed objects, which may affect the subsequent execution of objects or trigger the execution of objects. As a user, you can store these readouts in the script variables defined in EXEC. EXEC itself has no input parameters.
This topic provides information on the following:
- Overview
- Specifying Variable Settings
- Defining the Parameters
- Specifying Data & Formatting Settings
- Specifying the Script Access Setting
- Defining the Variable Usage in Other Clients
- Previewing Commands
- Example: Using an EXEC Variable in a Precondition
- Example: Using an EXEC Variable As a Data Sequence
You can use the dynamic Variable object EXEC in order to read and pass on the values of another executable object. In this case, the parameters in the dynamic Variable object EXEC must use the same names as are used in the PromptSet of the executable object that supplies the return codes.
PromptSet variables are supported in select fields for BACKEND, EXEC, FILELIST, SEC_SQLI, SEC_SQL, SQLI, SQL, and XML variable types. Using PromptSet variables are necessary when using the Dynamic Reload feature.
Field |
Description |
---|---|
Type | This read-only field shows "EXEC" as the variable type. You determine the variable type when you create the object. It cannot be changed once the variable is defined. |
Executable object |
The name of the Automation Engine executable object. You can use the icon to browse to an executable object. The following executable objects are recommended for use with EXEC Variables:
Schedule object types should not be used with EXEC Variables: No check is performed as to whether the right object type has been selected when you are defining the EXEC Variable object. |
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 feature for Combobox prompts. When PromptSet variables are used in dynamic Variable objects, and you click Preview, you will get an error. This is because the PromptSet variables do not exist in the dynamic Variable object. However, the PromptSet variables will be resolved when objects including the PromptSet are executed.
You must treat these parameters as though they were PromptSet/read buffer values. When VARA object calls the executable object, it uses :PUT_PROMPT_BUFFER to set the specified parameters. This means that in order to read and use these values in the called executable object, you must do one of the following:
- Create a PromptSet on the called executable object with variables with the same names as the parameters set in the calling EXEC Variable object.
- Use the :READ command to read in the values of variables of the same names as the parameters set in the calling EXEC Variable object.
It is not sufficient merely to define the variables on the Variables page under Variables & Prompts for the called executable object.
Working in the Parameters Table
To: | Do this: |
---|---|
Add a row to the table |
Click in the appropriate section. Click the cells in the table to edit their values. |
Edit a cell in table row |
Click the cell in the table and edit its value. |
Delete one of more rows to the table |
Check the checkbox for the row(s) and click . |
Delete all rows to the table |
Check the checkbox column header and click . |
Cut one or more rows and them to the AWI clipboard |
Check the checkbox for the row(s) and click . |
Copy one or more rows and them to the AWI clipboard |
Check the checkbox for the row(s) and click . |
Paste row(s) from the AWI clipboard to the bottom of the table |
Click . |
Specifying Data & Formatting Settings
Field |
Description |
---|---|
Data Type |
The data type decides the format of the variable's value.
The exact format of the selected data type (with the exception of "String") can be determined in the Output Format field. Note the following if you change the data type of static Variable objects that already include values:
The data type of the script variable in question ("float", "signed", "unsigned", or "string") is irrelevant in values that have been retrieved from Variable objects with the data type "Number" when using the script element GET_VAR. The value can always be stored. Algebraic signs and decimal places are removed if they are not supported by the script variable's data type. The values are always passed on to the script as a "string" if a different data type has been specified in the Variable object. |
Limit text length Max. Text Length |
Enforces a maximum character length. Allowed values: 1 to 1024 If this option is deactivated, there is no limit. The Key column of VARA objects has a maximum limit of 200 characters. This limit always exists and cannot be increased or deactivated. The result column of dynamic variables has no limit. The length depends on the value columns. In static and dynamic variables, this limit refers to the first value column. The Key or result column is not checked. Values that exceed the maximum length are excluded. Only the data type "Text" shows these fields. |
Force upper case |
Lower case letters that are used in variable values are automatically converted to upper case. This only affects the first value column. Only the data type "Text" shows this field. |
Output Format |
This setting defines the format that should be used to retrieve values. The contents of this selection menu depend on the data type. Several different formats are available for each data type (except for the String type). The format that is used to enter value in static variables is irrelevant unless it is an AE-supported format of the data type in question. The values are then converted to the relevant output format. The data type "Text" does not show this combo box. Timestamp
Date
Time
Number
Some date formats include RR as a placeholder for the abbreviated year. Having both YY and RR accommodates different century-counting conventions based on the two digits of the abbreviated year value. For example: For example: The time value for the data type "Time" or "Timestamp" must be a 4 or 6-digit number. Decimal places are removed. 4-digit numbers are converted to hours and minutes. Examples: Data type: Timestamp |
Set min. value Min. value |
Enforces a minimum value. The data type "Text" does not show these fields. |
Set max. value Max value |
Enforces a maximum value. The data type "Text" does not show these fields. |
Specifying the Script Access Setting
You can specify what happens if a key is not found with the If key not found radio buttons.
To: |
Choose: |
---|---|
Have an error message displayed if an object attempts to access an item that is not available at runtime via script | Return error |
Not use the result of output format of when it is " " | Return initial values |
Defining the Variable Usage in Other Clients
In client 0 you specify how the VARA object will behave in other clients.
When you define Variable objects in system Client 0, they can be used in other clients, either because they refer to the values set in the Variable in Client 0 or because you copy the original object from Client 0 to other clients and, if necessary, edit its values in the target clients.
With the Variable Usage in Other Clients options you define the behavior of this Variable object in clients other than 0:
Option |
Description |
---|---|
Don't share but allow duplicates |
If you select this option, this VARA object is available in clients other than 0 and you can use it there. You can modify all of its parameters in the non-0 clients, which can then be different per client. The name of the variable can be kept in non-0 clients. This means that if there is already a VARA object in the non-0 client with this name, two independent VARA objects with the same name will be available. You can modify all the parameters of both variables independently per client. |
Share and allow read-only access |
If you select this option, this VARA object is available in clients other than 0 and you can use it there but you cannot modify any of its parameters. Additionally, the name of this VARA object must be unique system-wide. |
Share but keep attribute settings from system client |
If you select this option, this VARA object can be copied to non-0 clients. If you do so, it keeps all the definitions made on the Attributes page but you can edit the Key and Value settings in the non-0 clients. Each client can have its own Key/Value definitions. Only available for STATIC variables. |
To preview the variable, click Preview. A preview of the result values stored or transferred is displayed.
Example: 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"
Example: 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_PROECESS(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#.