Script variables
For most script actions, variables are required. There are several kinds of variables:
Dummies: Required for every different element in the script. When the script is run, an actual element will be linked to each dummy.
Parameters: Typically used to get input from the outside world, e.g., from an operator.
Memory files: Containers of values, typically provided by the script itself.
Credentials: These allow a script to use credentials stored in the Credentials Library. Available from DataMiner 10.7.0/10.6.10 onwards.
When you add a script action that contains a variable, a line will automatically be added in the section in question. However, depending on the script, it can be more convenient to make the variables first, and then create the script actions.
Note
- Prior to running a script, operators will first have to link the dummies and parameters to actual elements and values in the DMS. Therefore, it is best to give the variables a meaningful name the operators will be able to work with.
- To remove a variable, click the x to the right of it.
- To save or edit a script that uses credentials, you need to have access to those credentials; however, you can execute a script with credentials even if you do not have access to those credentials.
Creating a dummy
To create a new line in the DUMMIES section:
Either click Add in the DUMMIES section:, or
In a script action that requires a dummy, click the field where the dummy should be filled in and select Create new dummy.
You can then further specify the dummy properties in the DUMMIES section:
To change the name of the dummy, enter a new name next to Dummy.
To change the protocol for a dummy, click the underlined sections next to Protocol and Versions respectively, and select a new protocol and protocol version.
Optionally, to link a default element to a dummy, select an element in the underlined field next to Configuration element for this dummy. This can be particularly useful when a table parameter column is selected, as you will then be able to select an index from the available indices of the table of that default element in a dropdown list.
Creating a parameter
To create a new line in the PARAMETERS section:
Either click Add in the PARAMETERS section:, or
In a script action that requires a parameter, click the field where the parameter should be filled in and select Create script input.
You can then further specify the parameter properties in the PARAMETERS section:
To change the name of the parameter, enter a new name next to Parameter.
Optionally, link a memory file to the parameter to suggest possible values to the user who executes the script. To do so, click the underlined section next to Values file and select the file.
Creating a memory file
There are two kinds of memory files: memory files created within the script, and permanent memory files that contain an array of values.
Memory files created within the script
These files are used to hold a particular value used in a script. Within the script editor, you can manage these memory files as follows:
To add a memory file, click Add in the MEMORY FILES section, or, alternatively, in a script action that requires a memory file, click the field where the memory file should be filled in and select Create new memory file.
To configure a memory file, click the underlined sections in the MEMORY FILES section. The first section determines the memory file name, the second determines whether the file is volatile or persistent.
Note
For volatile memory files, the lifecycle of the values stored in the memory spaces is limited to the execution time of the script. Once the script is terminated, all data stored in the memory spaces is lost. For non-volatile memory files, the lifecycle of the values stored in the memory spaces is unlimited. The values are stored in a file on the hard disk of the DMA. They will survive different script cycles and even DMA reboots.
Permanent memory files
Outside of a script, you can create permanent memory files that contain an array of values. For example, a permanent memory file named “Cities” could have the names of various cities as its values.
These files can be managed in DataMiner Cube, in the memory files tab of the Automation module. See How can I manage permanent memory files?.
Creating a set of credentials
Click Add in the CREDENTIALS section to add a new line in this section.
Specify a name for the credentials next to Name.
Select a type of credentials from the Credentials Library using the dropdown list next to Type.
The available types are:
- Username and password: Credentials consisting of a username and password.
- Token: Credentials consisting of a token only
Note
In the script XML, these types are stored as
UserNameAndPasswordandToken. See Credential.Select a set of credentials from the dropdown list.
The dropdown list will show all credentials of the selected type that you have access to.
Note
- If you open a script that contains credentials you do not have access to, the names of those credentials are replaced by <Not Allowed>. If you have permission to edit scripts, you will not be able to save the script until you have replaced those credentials with credentials you have access to.
- If your user permissions change while you are working in the Automation module, the changes will only take effect after you have re-opened the module.
Tip
To retrieve the values of credentials from a C# code block, see Using credentials in an automation script.