Class ApplicationIntegration
- Namespace
- ArcanaDevelopment.adTempus.Client
- Assembly
- ArcanaDevelopment.adTempus.Client.dll
Allows applications run by adTempus to interact with the adTempus server.
[ComVisible(true)]
[Guid("48F71E48-C346-4E03-8690-BF03E7AA8CDF")]
public sealed class ApplicationIntegration
- Inheritance
-
objectApplicationIntegration
Remarks
This class can only be used from applications that were started by an adTempus job. Attempting to use it from any other application will produce an error.
To use the class, call Connect() to create a connection to the adTempus server.
Properties
Checkpoint
Gets the current Checkpoint for the job.
public string Checkpoint { get; }
Property Value
- string
JobInstanceID
The instance number for the job instance.
public int? JobInstanceID { get; }
Property Value
- int?
JobInstanceOID
The OID of the ExecutionHistoryItem representing this job instance.
public OID JobInstanceOID { get; }
Property Value
JobOID
The OID of the Job being executed.
public OID JobOID { get; }
Property Value
JobVariables
Gets the job variables for the current context.
public IReadOnlyDictionary<string, string> JobVariables { get; }
Property Value
- IReadOnlyDictionary<string, string>
Remarks
This collection is read-only. To set a variable, use SetJobVariable(string, string)
StepInstanceOID
The OID of the ExecutionHistoryHistoryStep representing the step being executed.
public OID StepInstanceOID { get; }
Property Value
StepNumber
Gets the current step number, if applicable.
public int? StepNumber { get; }
Property Value
- int?
StepOID
The OID of the JobStep being executed.
public OID StepOID { get; }
Property Value
Methods
CaptureFile(string, string)
Captures a file on disk and stores it in the job history.
public void CaptureFile(string fileName, string displayName)
Parameters
| Name | Type | Description |
|---|---|---|
fileName |
string | The path/name of an existing file. |
displayName |
string | The name that the file should use after it is captured. Specify null or empty string to use the original name. |
Remarks
The file is copied to the adTempus CapturedFiles directory when you call CaptureFile.
CaptureFileData(byte[], string, string, DateTime)
Stores data as a Captured File in the job history.
public void CaptureFileData(byte[] fileContents, string displayName, string originalPath, DateTime fileDate)
Parameters
| Name | Type | Description |
|---|---|---|
fileContents |
byte[] | The contents to write to the file |
displayName |
string | The file name to display for the data. |
originalPath |
string | The path to display for the file. Can be null or empty. |
fileDate |
DateTime | The timestamp to display for the file. |
Connect()
Establishes a connection to the adTempus server.
public static ApplicationIntegration Connect()
Returns
Remarks
Connects to the server and returns a new ApplicationIntegration object representing the connection. If the connection fails, throws an exception.
Connect(out Message)
Establishes a connection to the adTempus server.
public static ApplicationIntegration Connect(out Message failureMessage)
Parameters
| Name | Type | Description |
|---|---|---|
failureMessage |
Message |
Returns
Remarks
Connects to the server and returns a new ApplicationIntegration object representing the connection. If the
connection fails, returns null and the failureMessage contains an error message.
IsRunning()
Indicates whether the job step is still active.
public bool IsRunning()
Returns
- bool
Remarks
The ApplicationIntegration connection is only valid while the job step it is running under is active. If you attempt to perform any operations after the step ends, they will throw an InvalidOperationContextException exception. Use IsRunning to see if the context is still valid.
LogMessage(MessageType, int, string)
Logs a message to the Job Log for the job.
public void LogMessage(MessageType messageType, int messageCode, string message)
Parameters
| Name | Type | Description |
|---|---|---|
messageType |
MessageType | The message type (severity) |
messageCode |
int | The message code. Can be used to filter messages. Note: The value 100000 will be added to the messageCode when the message is recorded in adTempus. |
message |
string | The message text. |
Remarks
Each message logged with LogMessage creates a log message in the Job Log for the job and a record in the adTempus database. To avoid cluttering the job log and using large amounts of database space, use MessageTypeEnum.Debug for debug-level messages. These messages will be written to the Job Detail Log instead of the main Job Log. The detail log is a single log file with detailed/diagnostic information for the job, available from the Captured Files list for the job.
ReplaceVariableTokens(string)
Expands variable tokens in a string
public string ReplaceVariableTokens(string sourceString)
Parameters
| Name | Type | Description |
|---|---|---|
sourceString |
string | The string to expand tokens in. |
Returns
- string
Remarks
This method replaces any valid variable tokens it finds with the corresponding values.
For example, if Job Variable "SomeVariable" has the value of "423", calling ReplaceVariableTokens("Current value: %SomeVariable%") returns the result "Current value: 423".
This method does not support the expansion of inline functions.
SendNotificationMessage(NotificationMessage)
Sends a notification message through the adTempus notification system.
public void SendNotificationMessage(NotificationMessage message)
Parameters
| Name | Type | Description |
|---|---|---|
message |
NotificationMessage | The message to send. |
SetAdditionalResult(string, string)
Communicates additional result information to the host.
public void SetAdditionalResult(string key, string value)
Parameters
| Name | Type | Description |
|---|---|---|
key |
string | |
value |
string |
SetCheckpoint(string)
Sets the current checkpoint for the job.
public void SetCheckpoint(string value)
Parameters
| Name | Type | Description |
|---|---|---|
value |
string | The new value for the checkpoint |
SetJobVariable(string, string)
Adds or updates a Job Variable
public void SetJobVariable(string name, string value)
Parameters
| Name | Type | Description |
|---|---|---|
name |
string | The name of the variable to add or update. |
value |
string | The value for the variable |
Remarks
The variable is only defined for the current execution of the job.