Script Execution Task Properties
The Script Execution Task Properties window is shown when you edit a Job Step that executes a Script Execution Task.
Property Pages
General
Name for this step (optional)
Optionally, specify a descriptive name for the step.
Enable this step
Uncheck this box to disable the step. If the step is not enabled, it will be skipped at execution.
Description/Notes
Enter any extended descriptive information or notes for this step.
Conditions
The Conditions page defines conditions that must be satisfied before the step is run.
Condition Criteria
The Condition Criteria determine how the conditions should be evaluated:
- Execute only if all conditions are met. The step is only executed if all of the listed conditions are met.
- Execute if any condition is met. The step is executed if any of the listed conditions is met.
If Conditions are not satisfied
The satisfaction options determine what adTempus should do if the conditions are not satisfied:
- Fail the step. The step is not executed; the status is set to Failed.
- Execute anyway. The step is executed anyway.
- Skip the step (do not report as a failure). The step is not run, but it is not treated as a failure. The status of the step is reported as "Skipped (conditions not met)."
Conditions List
The Conditions list lists the conditions that have been defined for the step. You can add, edit, or delete conditions. See the Conditions topic for information on the available condition types.
Variables
The Variables page allows you to define Job Variables for this step. You can add new Variables, or override the values of Variables inherited from the Job. Any Variables you define or override here affect only this step of the Job.
To set Variables that apply to the entire job, use the Variables page in the Job properties.
Responses
The Responses page defines the actions that adTempus should take in response to events that are fired during execution of the step. You can add, edit, delete, or reorder responses.
All job steps support the events listed below. Some tasks may define additional events .
Event | Description |
Step Started | Occurs at the beginning of the step. |
Step Ended | Occurs at the end of the step, regardless of the step result. |
Step Failed | Occurs if the step fails for any reason. |
Step Restarted | Occurs if the step is restarted due to a Response. |
Restart Limit Exceeded | Occurs if the restart limit is exceeded. |
Step skipped | Occurs when the step is skipped, either because conditions were not met (if the Skip... option is selected on the Conditions page) or due to a skip option specific to the task. |
One or more conditions failed | Occurs if one or more Conditions for the step is not satisfied. |
Conditions not met within the specified time |
Occurs if the job or a step within the job has been waiting for conditions for longer than the specified time. |
In addition to the standard response events, this task defines the following events:
Event | Description |
Task completed with an exit code that meets these criteria | Occurs when the target script finishes and returns a result that matches the criteria you specify. |
Task executed but returned failure result | Occurs when the target script finishes and, based on the Success Criteria on the Options page, is determined to have failed. |
Task returned successful result | Occurs when the target script finishes and, based on the Success Criteria on the Options page, is determined to have succeeded. |
Task will be terminated because it exceeded its allowed execution time | Occurs once the time limit has elapsed, but before adTempus attempts to terminate the process. Respond to this event if you want to use your own script or other approach to end the script. |
Task was terminated because it exceeded its allowed execution time | Occurs once the time limit has elapsed, after adTempus has terminated the process. |
Script returns a result that meets these criteria | Occurs when the script returns a result that matches (exactly) the string you specify. |
Execution time reached a threshold | Occurs when the script runs for longer than the specified time. |
Script
Script to Execute
Your script may be either an internal script (stored within adTempus and optionally shared with other jobs) or an external script (an external script file). The way the script is executed, and the options available to it, are the same either way.
Execute a script stored in adTempus
Select an existing script or create a new one. See the Scripts topic for information on working with internal scripts.
Execute a script stored in an external file
Specify the script file to execute. You must also specify the Language of the script. If you select a language other than one of those listed, the language name you enter must be a scripting language recognized by the Window Scripting Host on the adTempus server.
Run isolated from other scripts
When this option is checked, this script will run in a host process that is not shared by any other scripts. See the Script Security and Isolation topic for more information. If this option is not checked,
- For a "script stored in adTempus," the setting from the Script Properties is used.
- For a "script stored in an external file," the script is not run in isolation.
PowerShell Options
If you select a PowerShell script, the following additional options are available.
Capture console output from script
Check this option to capture the output written by the PowerShell script to stdout and stderr.
Command-Line Parameters
Use this box to pass command-line parameters to the script. Parameters can be retrieved using the $args collection or named parameters in the script. Specify the parameters just as you would do if calling the script from a PowerShell command prompt.
Options
Success Criteria
The Success Criteria determine whether the step is reported as Successful or Failed. Three options are available:
- The script will return a numeric result code. Your script will return a numeric result (see Returning a Result From a Script). The step will be reported as successful if the result meets the criterion you specify. By default, adTempus expects your script to return a value of "0" if it succeeds, consistent with the convention used by most programs.
- Report the step as successful unless instructed otherwise by a Response. adTempus will ignore the exit code and assume that the task was successful. You can change the status of the step using a Job Control Action.
- Report the step as Failed unless instructed otherwise by a Response. adTempus will ignore the exit code and assume that the task failed. You can change the status of the step using a Job Control Action.
You can also test for any number of specific exit codes or string results and take action based on them using Responses for the step. For example, you may want to report the step as failed if the exit code is greater than 0, but send e-mail notification to an administrator if the exit code is greater than 128.
Time limit
Specify the maximum time (in minutes) that the script should be allowed to run. This feature protects against "runaway" scripts.
If you are running an internal script, adTempus will use the lesser of the value you specify here and the value specified on the Script's properties.
Related Concepts