Program Execution Task Properties
The Program Execution Task Properties window is displayed when you edit a Job Step that runs a Program 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 program finishes and returns a result that matches the criteria you specify. |
Task executed but returned failure result | Occurs when the target program finishes and, based on the Success Criteria on the Advanced page, is determined to have failed. |
Task returned successful result | Occurs when the target program finishes and, based on the Success Criteria on the Advanced page, is determined to have succeeded. |
Task started | Occurs once the target program has been successfully started. Does not occur until after adTempus has waited as directed in the Startup Determination options on the Advanced page. |
Task will be terminated because it exceeded its allowed execution time | Occurs once the time limit specified on the Advanced page 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 process. |
Task was terminated because it exceeded its allowed execution time | Occurs once the time limit specified on the Advanced page has elapsed, after adTempus has terminated the process. |
Execution time reached a threshold | Occurs when the program runs for longer than the specified time. |
Execution Target
Target Type
The Program Execution Task supports three kinds of target:
- Single program or external batch file. You specify a single target for adTempus to execute. This can be a program, batch file, document file, etc.
- Batch file stored in adTempus. When you select this option, adTempus displays an editor that allows you to create a standard Windows batch file that is stored in adTempus. When the step executes, the batch file is executed just like a normal batch file. Using this option instead of an external batch file makes it easier to track changes to the batch file and to make sure the batch file gets included if the job is deployed to another computer.
- Shared batch file stored in adTempus. When you select this option, you can select or create a shared batch file. This allows you to reuse batch files in different jobs and steps. Shared batch files can be managed from the Shared Scripts view.
These settings apply if you choose to execute a single target.
Target
Specify the program, batch file, script file, document file, etc., to be executed. You may specify here essentially anything that is valid when using the Run command from the Windows Start menu. You do not need to include quotation marks around the target: they will be added for you if necessary.
Only specify the program or document path and name here. Any parameters or options that need to be passed to the program must be entered in the command-line parameters box below.
For example:
c:\program files\serverdatacopy\prod1.exe | Runs the "prod1.exe" program. |
c:\data\mydocument.doc | Launches Microsoft Word and loads mydocument.doc. |
c:\cmd\copydata.cmd | Runs the copydata.cmd batch file. |
Command-Line Parameters
Specify any command-line parameters that should be passed to the program.
There are two ways to insert dynamic data into the command line:
- Use a script (see next section) to build the command line
- Use Job Variables or Inline Functions within the Command-Line Parameters box.
Use a script to specify command-line parameters
Check this option to use a script to set the command-line parameters. For example, you can use a script to pass the names of all the files found in a specific directory to the target application.
See the Script Overview topic for information on working with scripts.
Skip this step if the process is already running
When this option is checked, it is like having a Process Condition on the target process. If the target process is already running (regardless of whether it is under the control of adTempus), the step will be skipped.
This option is only valid when you have specified an executable file (.exe) as the Target. The option will not work with other kinds of targets (such as .bat or .cmd files, or documents).
If you choose the batch file target option, you will see an editor in which you can edit your batch file. The batch file must use standard Windows batch file syntax.
For a new step, adTempus will fill the editor with a template batch file that demonstrates how to use checkpoints in your batch file. When you use checkpoints, the job status will show what the most recent checkpoint was during execution, and you can start or restart the batch file from any checkpoint.
When you check the Automatically insert checkpoints option, adTempus will automatically insert a checkpoint after each label (line beginning with ":") that it finds in the batch file. If this option is not checked, you must insert your own checkpoints as described in the checkpoints topic.
A batch file can call other shared batch files during execution. To insert a reference to another batch file, place the cursor at the point in the batch file where you would like to call the other batch file, then select the target file from the Call shared batch drop-down list. See the Calling Shared Batch Files topic for more information.
If you choose the shared batch file target option, you will see a selector that allows you to select an existing shared batch file or create a new one. Shared batch files can be managed from the Shared Scripts view.
When you check the Automatically insert checkpoints option, adTempus will automatically insert a checkpoint after each label (line beginning with ":") that it finds in the batch file. If this option is not checked, you must insert your own checkpoints as described in the checkpoints topic.
Common Settings
These settings apply to single-target and batch file targets.
Startup Directory
Specify the startup ("working") directory to be associated with the program. For most programs, it is not necessary to specify this directory.
Capture screen output from console-mode program
This option can be used with console-mode programs only. When this option is selected the program is run on a hidden desktop (and so is not visible to any user who is logged in to the computer). The output that the program writes to the console is captured in a file, which is stored in the execution history for the job. To review the output, view the properties for the instance once the step completes. The console output will be found in the Captured Files list for the job, with the name console output.txt.
Execution Priority
Specify the priority that the operating system should assign to the process.
Advanced
Limit execution to __ seconds
When this option is checked, adTempus will terminate the process if it is still running after the specified number of seconds.
This option should generally be used only as a last resort to terminate an application that is not behaving properly. adTempus cannot always terminate the process cleanly, and this can lead to problems (such as data corruption) with your application. See How adTempus Terminates a Process for more information.
If the task being executed is a batch file, adTempus terminates the batch file and any program(s) started by the batch file. This is a change from adTempus 3 and earlier, which did not terminate processes created by the batch file.
Before the process is terminated adTempus executes any Responses that include the "Before process is killed" event.
Startup Determination
The Startup Determination option can be used to allow an application to finish initializing before job execution continues. This option is useful when a subsequent action or step needs to interact with the program. Three options are available:
- As soon as it is launched. adTempus does not wait at all. As soon as it has launched the program, it moves on.
- Once the program is waiting for user input. adTempus waits until the program has completed initialization and its Windows message loop is waiting for messages.
- After __ seconds. Specify a delay, in seconds.
Success Criteria
The Success Criteria determine whether the step is reported as Successful or Failed. Four options are available:
-
Decide based on the program's exit code. adTempus will look at the exit code returned by the process and evaluate it based on the rule you specify. If the exit code meets the criteria, the step will be reported as Successful; otherwise it will be reported as Failed.
Many—but not all—programs return an exit code to indicate their status. By convention, an exit code of 0 indicates success; an exit code greater than 0 indicates failure.
Note that the meaning of a particular exit code is dependent on the program being run. adTempus does not know what if anything an exit code means—it can only detect and respond to the exit code.
For more information see the Exit Codes topic.
- 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.
-
Use a script. adTempus will ignore the exit code and will execute the script that you specify. The result of this script will determine whether the step succeeded.
This feature can be used, for example, when you are running a program that does not produce a meaningful exit code, but produces a file if it succeeds. You could use a script to check for the existence of the file and set the step's status accordingly.
You can also test for any number of specific exit codes 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.