There are some points that require particular consideration when you use or replace variables.
Variables that are used in scripts are replaced before the scriptA particular Automation Engine object type. is processed.
Predefined variables are quite similar to script variables. Their values can be read and used at any point. Predefined variables, however, are not created and they have a predefined name. Thus, they cannot be modified in the script and any attempt to do so will result in an error:
:SET&$CLIENT# = 17
As opposed to attributes, AE Script does not support the use of variables for Variable objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task values. Therefore, they are not available in the Variable picker. Use the script element GET_VAR to access Variable objects via script.
Using the script element :PUT_ATT to write a predefined variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. to an attribute has the effect that it will be inserted without any changes and replaced only after the script has been processed. If a script modifies an attribute that represents a predefined variable used in the object, the new value is used for the replacement. In the script, the new variable value is applied starting with the modifying scripting line.
Example:
Job with the following attributes:
Internal account: Acc1
Archive key 1: &$INT_ACCOUNT#
This scripting line writes the predefined variable for the agentA program that enables the de-centralized execution of processes (such as deployments) on target systems (computers or business solutions) or a service that provides connectivity to a target system (such as for databases or middleware). An agent is also an object type in the Automation Engine. [Formerly called "Executor."] See also: host name to the attribute "Internal account":
:PUT_ATT INT_ACCOUNT = &$HOST#
Variables are replaced after the script has been processed. The internal account and Archive key 1 obtain the agent's name as their value.
Variables for attributes that are used in the script have no value at the position at which they include predefined variablesFixed variables that can be used in the attributes or the script of executable objects. The values refer to the object or the system. themselves.
Using GET_ATT to read an attribute that includes predefined variables has the effect that the value is returned without any replacements being made.
Variables used within JCL or script literals are not replaced.
The script editor's auto-completion functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… lists the variables that are already in use.
Note that numerical predefined variables are automatically formatted to 16 digits if they have been enclosed in parentheses () in the script element :SET.
For example: The original 4-digit format of the clientA closed environment within an Automation Engine system where you can create and run objects. A client name consists of a 4-digit number that must be indicated when a user logs on to the Automation Engine system. Users and their rights are also defined in clients. A particular Automation Engine object type. is lost. The script variableA placeholder for a value within a script. &CLNTNR# obtains a value such as "0000000000008100".
:SET &CLNTNR# = (&$CLIENT#)
The values of predefined variables that are used in attributes are replaced after the script has been processed. If the variable name is invalid it cannot be replaced. Automic recommends checking the correct syntax and the object typeAn individual object is provided for the individual activities: There are User, UserGroup, Notification, Cockpit, CodeTable, Documentation, Event, Agent, FileTransfer, Group, Include, Job, Workflow, Calendar, Login, Client, RemoteTaskManager, Schedule, Script, Server, Sync, Variable and TimeZone objects or using the Variable picker to insert the variables.
Variables that are used in their own attribute are not replaced. The same is true for two attributes that refer to each other through variables.
Any other combination of object attributes is possible.
Example:
Attributes of a Windows jobAn Automation Engine object type for a process that runs on a target system.:
Working directory: C:\temp\work_&$date_yyyymmdd#\
Command: UCYBDBld -B -C0001 -X&$WORK_DIR#\UC_DATA.TXT -EREPLACE
The content of the Command field depends on the working directory which includes a system value variable. First, the date is entered in the "working directory" field and then the variable is replaced by the corresponding content in the "Command" attribute.
If the replaced attribute value exceeds the defined maximum length, it will be truncated at the field end.
In attributes, you can also use predefined variables for Variable object values.
Predefined variables for system and object values can also be used as part of a variable placeholder. Example: {VARA&$CLIENT#}
This is not possible the other way round because system and object values are inserted before variable values.
See also:
About Predefined Variables
"Variable Picker" Dialog
List of Predefined Variables for System and Object Values
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |