Objectives:
- Creating script variables
- Assigning values to variables
- Printing variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. values
Script variables can be used to store and pass on values in scripts. For example, you can use them to obtain the return codeThe value that represents the result of tasks and script functions. of a particular scriptA particular Automation Engine object type. functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,….
You can create script variables with a particular data type. The data type is decisive for the values that can be stored in script variables. The following data types are available:
Variable names start with a & character; the second character must not be a number.
We will now create two script variables, assign values to them and have the values output in the activation protocol:
Open any executable objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task of your choice and open the Process tab.
Create the first script variableA placeholder for a value within a script. by using the script element :DEFINE. The data type must be defined and cannot be changed subsequently. Select the data type "signed" because the variable should store a negative number. Now use the script element :SET in order to assign a value.
:DEFINE &number#,signed
:SET &number# = -1
Create the second script variable directly with :SET and set it to the value "test". In this case, the variable can subsequently be changed to any value of your choice. This means that the data type depends on the value.
:SET &string# = "test"
Use the following scripting line to write the values of both variables to the activation protocol. You must use the & character twice in order to have the variable name output.
:PRINT "&&number# = &number#, &&string# = &string#"
Store and execute the object. The activation protocol now includes the following line:
2011-04-06 14:48:17 - U0020408 &number# = -0000000000000001, &string# = test
More detailed information about script variables is available here.
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |