Table of Contents

Class ProgramExecutionTask

Namespace
ArcanaDevelopment.adTempus.Client
Assembly
ArcanaDevelopment.adTempus.Client.dll

Task that runs an external program, script, batch file, etc.

public sealed class ProgramExecutionTask : Task
Inheritance
object
ProgramExecutionTask

Properties

BatchScript

Gets or sets the stored batch file to execute.

public Script BatchScript { get; set; }

Property Value

Script

Remarks

Use this setting if you want to have adTempus run a batch file that is stored in adTempus (and editable through the Script Editor in the user interface). To use this option create a Script with the ScriptLanguage set to "Batch".

At execution, the script content will be written to a temporary file and executed as a batch file.

If BatchScript is specified, the ExecutionTarget is ignored.

BatchScriptAutoCheckpoint

Determines whether adTempus will insert checkpoints in batch files when running a BatchScript.

public bool BatchScriptAutoCheckpoint { get; set; }

Property Value

bool

Remarks

If this option is True, adTempus will insert a checkpoint call immediately after each line of the batch file that is a label (a line that starts with ":"). The label name will be used as the checkpoint name.

ClassID

The Class ID for the object

[IgnoreDataMember]
public override ClassID ClassID { get; }

Property Value

ClassID

ClassKeyName

The key name for the class.

public override string ClassKeyName { get; }

Property Value

string

Remarks

This name the name used by adTempus to identify the class and is intended for programmatic use only. Use the ClassName for a user-friendly name.

CommandLineParameters

Optional command-line parameters to pass to the ExecutionTarget

public string CommandLineParameters { get; set; }

Property Value

string

Remarks

This value is ignored if BatchScript is set.

To generate a command line dynamically, use CommandLineScript

See Also

CommandLineScript

The script to execute to generate the command line parameters

public Script CommandLineScript { get; set; }

Property Value

Script

Remarks

If used, adTempus will execute this script and used the result as the command line parameters for the ExecutionTarget

ConsoleCaptureOptions

Determines whether/how console output (STDOUT) is captured for this process

public ConsoleCaptureOptions ConsoleCaptureOptions { get; set; }

Property Value

ConsoleCaptureOptions

Remarks

Console capture can only be used for console-mode programs (i.e., programs that write output to the console window when run from a command prompt). Turning on console capture for other process types may cause failures.

CustomData

Data for the custom user interface for this object.

public string CustomData { get; set; }

Property Value

string

CustomUIClass

Class of the custom user interface for this object.

public string CustomUIClass { get; set; }

Property Value

string

ExecutionTarget

The program, script, batch file, etc., to execute.

public string ExecutionTarget { get; set; }

Property Value

string

Remarks

Specify the full path and name of the process, script, batch file, etc., to execute, e.g.,

c:\program files\my files\someprogram.exe

.

If no path is included, Windows will search for the target using the Path environment variable in effect for the user whose account the job runs under.

Do not include quotes around the ExecutionTarget, even if it contains spaces. Do not include command-line parameters: those must be specified in CommandLineParameters.

To run a batch file that is stored within adTempus, set the BatchScript. ExecutionTarget is then ignored.

ExitCodeCriterion

The rule to apply to the process exit code when SuccessCriterion is ExitCode

public ExitCodeTestType ExitCodeCriterion { get; set; }

Property Value

ExitCodeTestType
See Also

IsDependent

Indicates whether the object is a dependent of (owned by) another object

[IgnoreDataMember]
public override bool IsDependent { get; }

Property Value

bool

Remarks

An independent object (IsDependent is false) is an object that can exist on its own without being part of another object. For example, Jobs, Job Groups, etc.

A dependent object (IsDependent is true) is a part of another object. For example, a JobStep cannot exist independently of a Job, so the JobStep is dependent.

Dependent objects cannot be directly fetched from the server: they are only fetched as part of the object they belong to. They also cannot be saved or deleted independently: they are automatically saved or deleted when the owning object is saved or deleted.

MaxRunTime

The maximum time (in seconds) this task is allowed to run

public int MaxRunTime { get; set; }

Property Value

int

Remarks

Set to 0 (the default) for no limit. If the task exceeds the MaxRunTime, adTempus terminates it.

Priority

The operating system priority to assign to the process

public ProcessPriority Priority { get; set; }

Property Value

ProcessPriority

Remarks

The default value is NormalPriority

SkipIfAlreadyRunning

If true, the step will be skipped if the ExecutionTarget is already running

public bool SkipIfAlreadyRunning { get; set; }

Property Value

bool

StartupDirectory

The startup (working) directory to assign to the process.

public string StartupDirectory { get; set; }

Property Value

string

Remarks

This value is optional. If specified, it must be a valid directory or the process will fail to start. Windows does not support UNC paths for the StartupDirectory so this must be a path anchored with a drive letter.

SuccessCodeRange

The range(s) of exit codes to use if ExitCodeCriterion is InRange or NotInRange

[RequiredVersion(5, 0, 0, 0)]
public string SuccessCodeRange { get; set; }

Property Value

string

Remarks

This must be a list of exit codes in the form

1,2-8,12,15-17,23

.

SuccessCriterion

The rule used to determine whether the process executed successfully.

public SuccessCriterion SuccessCriterion { get; set; }

Property Value

SuccessCriterion

Remarks

The default value is ExitCode

See Also

SuccessMaxCode

The maximum (inclusive) exit code that represents success when ExitCodeCriterion is BT

public int SuccessMaxCode { get; set; }

Property Value

int

Remarks

The SuccessMaxCode is only used for BT. For all other test types use SuccessMinCode.

SuccessMinCode

The minimum (inclusive) or single exit code that represents success

public int SuccessMinCode { get; set; }

Property Value

int

Remarks

When ExitCodeCriterion is BT the SuccessMinCode represents the minimum value (inclusive) of the range that represents success. For all other test types, the SuccessMinCode is the value that is compared against.

SuccessRuleScript

The script to execute to determine whether the process executed successfully, when SuccessCriterion is Script

public Script SuccessRuleScript { get; set; }

Property Value

Script

SupportedResponseEvents

Gets a list of the events that are supported for Responses associated with this task.

public override ReadOnlyCollection<SupportedResponseEvent> SupportedResponseEvents { get; }

Property Value

ReadOnlyCollection<SupportedResponseEvent>

WaitLimit

The number of seconds to wait when WaitOptions is WaitForSpecifiedTime

public int WaitLimit { get; set; }

Property Value

int

WaitOptions

Specifies how adTempus should wait after the process is started

public WaitOptions WaitOptions { get; set; }

Property Value

WaitOptions

Remarks

The default is NoWait. The other options are useful primarily if a subsequent action in the job needs to send a signal to the process, in which case it may be necessary to wait to ensure the process has finished initialization and is ready to receive messages.

Methods

GetObjectDescription()

Gets a description of the object's key settings.

protected override string GetObjectDescription()

Returns

string

Remarks

This method is called by GetDescription() to get a user-friendly description of the object (such as its key settings) for display to the user. The description should contain enough information to distinguish this object from others of the same class.

WriteToConfigurationReport(IADTObjectConfigurationReportWriter)

Writes the object and any contained objects to a configuration report

public override void WriteToConfigurationReport(IADTObjectConfigurationReportWriter reportBuilder)

Parameters

NameTypeDescription
reportBuilder IADTObjectConfigurationReportWriter

The report builder to write the object to.

Inherited Members