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

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.
New feature iconExecution time reached a threshold Occurs when the program runs for longer than the specified time.

Execution Target

New feature iconTarget 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.

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.