Objectives:
- Calling scriptA particular Automation Engine object type. functions
- Storing the script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,…'s return codeThe value that represents the result of tasks and script functions. in a script variableA placeholder for a value within a script.
- Having the variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. output in the activation protocol
Script functions are AE Script elements that supply return codes. Many functions supply values and also execute particular actions. Script functions must not be placed at the beginning of a line and can only be used in combination with script statements. The UserInterfaceThis is the Automation Engine's graphical user interface. [Formerly called the "Rich Client", "RichGUI" and "Dialog Client."]'s script editor displays them in red.
A function's name is followed by parentheses ( ) that can include parameters.
The following lesson describes an arithmetic operation that is executed by using a script function.
The first step is to create a script variable with the data type "float" (see also lesson 3).
:DEFINE &result#, float
The script function DIV is used to perform a division. This function has two parameters: the numbers 1 and 2.
Number 1 is divided by number 2. The return code is the result of the division. To store it in a script variable, the script statement :SET is required.
The following line is the result of combining the script statement :SET, the script variable &result# and the script function DIV:
:SET &result# = DIV(1,4)
The result should now be output in the activation protocol.
:PRINT "Result: 1/4 = &result#"
Result that is shown in the activation reportA report provides more detailed information about a task's execution or a component.:
2011-04-06 14:48:17 - U0020408 Result: 1/4 = +0000000000000000.2500000000000000
Another example of a script function is FORMAT which can now be used to format the result of the division. The following example removes unnecessary leading and final zeros:
:SET &format# = FORMAT(&result#,"0.00")
:PRINT "Formatted result: &format#"
Activation protocol:
2011-04-06 14:48:17 - U0020408 Formatted result:0.25
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |