Script Statement: Stores a value in a Variable objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task.
:PUT[_VAR] Variable, [Key], Value, [Value], [Value], [Value], [Value]
Syntax |
Description/Format |
---|---|
Variable |
The name of the Variable object to which one or several values should be assigned.
|
Key |
The line in which the value should be stored.
|
Value |
Entries that should be written to the particular value columns. Values of non-specified columns are deleted. Existing values are overwritten.
Should you use this statement with the Variable object XML, only complete (i.e. well-formed) XML is allowed. |
A runtimeThe duration of a task's execution. It refers to the period between a task's start and end. It does not include its activation period (see also: activation and start). error occurs if a dynamic variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. (source: SQL, SQL internal, multi or data type) is used in this script element. Only static Variable objects can be filled using :PUT_VAR.
The following general rules apply:
Separate the individual values by using commas, if you want to fill several value columns of a variable. Static variables are limited to 5 value columns.
If a key is not specified for a static Variable object, the system automatically selects the key based the Scope setting on the Attributes tab of the Variable object.
The parameter Key is optional if the setting Scope - "no validity key" is selected in the Attributestab. In this case, the variable contains only one value. Ensure that the commas are set in the statement even if Key is not used.
You can also specify the individual values without using inverted commas. Commas are used as separators.
Variable objects may have different numbers of values. If you enter more values than the object provides, an error message is displayed.
When using this script statement with the static Variable object XML, the values for XML data type will be beautified automatically. That means, you may use XML in a single script line for example, but in the object the value will be rearranged according to the XML standard.
For example: Values are entered in all the five value columns.
:PUT_VAR VARA.TEST, "KEY1", "Value1", "Value2", "Value3", "Value4", "Value5"
To write a value that includes one or several commas in one line, you must enclose this value in single-quote or double-quote characters.
For example: "Value1" is written to the value column 1 and "Value2, Value3, Value4" to column 2.
:PUT_VAR VARA.TEST, "KEY1", "Value1", "Value2, Value3, Value4"
In the following example for the Variable object XML only one value is used, as the Variable object of the type XML only contains one value field:
:PUT_VAR VARA.XML, "KEY1", "<Value1>this is a test</value1>"
One of the following formats must be selected in order to store a value in a variable of data type "timestamp":
The data types "Time", "Date" and "Number" require the value to be specified in the defined output format (Attributes tab).
Important note for the data type "Number": Redundant decimal places are truncated if an attempt is made to store a number with more decimal places than have been defined in the output format.
This script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… writes values to a Variable object even if a userIn the Automation Engine, a user is an instance of a User object, and generally the user is a specific person who works with Automic products. The User object is assigned a user ID and then a set of access rights to various parts of the Automation Engine system and product suite. These access rights come in the form of Automation Engine authorizations and privileges, Decision user roles and EventBase rights and ARA web application object rights. You can manage all these centrally in the ECC user management functions. See also, Unified user management. has opened it in order to ensure that there is no interference with processing. A warning displays if a user tries to store the modifications that were made in this Variable object. It contains the information that the variable has been modified in the meantime. The user can now decide whether the modifications should be stored or removed.
For the data type "String", leading blanks remain in the content. Blanks at the end of the string are truncated.
The following peculiarity applies if :PUT_VAR is used before a :READ statement: If script generation is canceled manually using the "Cancel" button or due to invalid default values (see "Generate at runtime"), the Variable object still contains the values that were set with :PUT_VAR.
In the following example the current date and time are determined and saved in a Variable object of the data type "Time stamp". Date and time are transferred to the script statement as script variables.
:SET &DATE# = SYS_DATE("YYYY-MM-DD")
:SET &TIME# = SYS_TIME("HH:MM:SS")
:PUT_VAR BOOKING.DATE,
, "&DATE# &TIME#"
The variable "ATTRIBUTES", which is used in the following example, contains the scope "Freely selected". Therefore, the Key must be entered.
:SET &PRIO# = GET_ATT("UC4_PRIORITY")
:PUT_VAR ATTRIBUTES,
"CurrentPriority", &PRIO#
In the following example, a taskAn executable object that is running. Tasks are also referred to as activities.'s name, 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 and parentThere are different ways of activating objects. The originator of an activation is referred to as the superordinate task (parent). See also: Child; Children information are stored with the task's RunIDShort for "run number". It is a number that provides unique information about a task's execution. The RunID can include 7 to 10 digits. It is assigned by the Automation Engine component . in the Variable object "OBJECT_STAT".
:SET &PNAME# = SYS_ACT_PARENT_NAME()
:SET &PNR# = SYS_ACT_PARENT_NR()
:SET &PTYPE# = SYS_ACT_PARENT_TYPE()
:SET &NAME# = SYS_ACT_ME_NAME()
:SET &NR# = SYS _ACT_ME_NR()
:SET &TYPE# = SYS_ACT_ME_TYPE()
:PUT_VAR OBJECT_STAT, "&NR#", "object name: &NAME#", "object type: &TYPE#", "parent name: &PNAME#", "parent runid: &PNR#", "parent object type: &PTYPE#"
See also:
Script element | Description |
---|---|
Deletes one or all values of a Variable object. | |
GET_VAR | This returns the value of a Variable object. |
|
|
:SET_SCRIPT_VAR | Sets the values of script variables by indirect access. |
Returns the values of script variables by indirect access. | |
PREP_PROCESS_VAR and PREP_PROCESS_VAR_XML | Prepares the processing of a data sequenceAn internal listing of Console outputs or lines of Variable objects, etc. The lines of a data sequence can be accessed by using a PROCESS loop or the script element GET_PROCESS_LINE. The script elements PREP_PROCESS* generate data sequences. (values of a Variable object). |
Script Elements - Read or Modify Objects
Sample Collection:
Display with Cockpit
Database Maintenance with Options
Calling an MBean
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |