Using Scripts in adTempus
Scripts are small "programs" that you write in various programming languages to carry out a task or add functionality to adTempus.
Scripts are represented within adTempus by the Script object, which allows you to share scripts among jobs and users, and to restrict the use of scripts with security settings.
Scripts can interact with adTempus using the script integration API to perform actions like getting and setting Job Variable values, setting the Checkpoint for the job, logging messages to the Job Log, and sending e-mail messages.
Kinds of Scripts
There are two broad categories of scripts in adTempus:
- Task Scripts are scripts that run as the tasks of Job Steps. Generally the purpose of a task script is to accomplish a task that is external to adTempus.
- Extension Scripts are scripts that run to augment or customize the behavior of adTempus.
Task Scripts
You may already have scripts on your computer—such as VBScript (vbs) or PowerShell (ps1) scripts—that you use to perform various processing tasks. You can execute these scripts in adTempus using the Script Execution Task.
We also include Windows batch files in this category, because they are in some ways treated like other scripting languages within adTempus . However, since they are in other ways quite different from other scripting platforms, batch files are run using the Program Execution Task instead of the Script Execution Task.
The following scripting languages are supported for Task Scripts:
- .NET scripting using VB.NET and C#. This exposes the full power of the Microsoft.NET programming framework, without the need for a separate development environment or compiler.
- Windows Script Host (WSH) scripts such as VBScript and JScript.
- Windows PowerShell scripts.
- Windows batch files (run using the Program Execution Task).
Extension Scripts
adTempus lets you use scripts to extend and customize the behavior of adTempus. Scripts can be used:
- As Conditions, to determine whether a job or job step should run.
- As Actions, to perform quick tasks within adTempus.
- In Response Events, to determine when Responses should run.
- To determine whether a job step executed successfully.
- To dynamically determine the command-line parameters for a program to be executed by adTempus.
- To define inline functions, which allow you to call scripts and insert their return values anywhere that Job Variables are supported.
The following scripting languages are supported for Task Scripts:
- .NET scripting using VB.NET and C#. This exposes the full power of the Microsoft.NET programming framework, without the need for a separate development environment or compiler.
- Windows Script Host (WSH) scripts such as VBScript and JScript.
Windows Script Host scripts are supported primarily for backward compatibility. When creating new scripts you are encouraged to use VB.NET or C#, which provide a much more powerful programming environment.
In certain contexts within adTempus the WSH script languages are not supported, and will not appear in the list of available languages. In other contexts scripts written in these languages may not have access to all of the same adTempus context information or features as a .NET script.
Shared Scripts
Shared Scripts are scripts that can be used by more than one job. Any changes made to a Shared Script affect all jobs that use the script.
Shared Scripts are managed through the Shared Scripts view in the adTempus Console. When you create a Shared Script, you can use the security settings to determine which users are allowed to use or modify the script.
Script Libraries
Script Libraries allow you to create libraries of commonly-used code or data that can be shared among scripts in adTempus. This is equivalent to creating a "function library" or "class library" to be used by adTempus scripts.
Script Libraries are managed through the Script Libraries view in the adTempus Console. When you create a Script Library, you can use the security settings to determine which users are allowed to use or modify the script.