Table of Contents

Class UserScriptBase

Namespace
ArcanaDevelopment.adTempus.ApplicationIntegration
Assembly
ArcanaDevelopment.adTempus.ApplicationIntegration.dll

Base class for all user scripts.

[Serializable]
public abstract class UserScriptBase : MarshalByRefObject
Inheritance
object
MarshalByRefObject
UserScriptBase
Derived

Remarks

All user scripts run in adTempus are implemented in a class that derives from UserScriptBase.
Depending on the purpose for which the script was created, it may inherit from a specialization of UserScriptBase. For example, a script created for use by a File Trigger will inherit from FileTriggerScriptBase.

Constructors

UserScriptBase()

Constructor

protected UserScriptBase()

Fields

CancellationToken

CancellationToken that is set when adTempus terminates the script.

protected readonly CancellationToken CancellationToken

Field Value

CancellationToken

Properties

IsTerminated

Indicates whether termination has been requested for the script.

protected bool IsTerminated { get; }

Property Value

bool

Parameters

Gets the parameters for the script.

public virtual IScriptParameters Parameters { get; }

Property Value

IScriptParameters

Remarks

The type of the Parameters object will depend on the context in which the script is being used. For example, if the script is being run by a File Trigger, the parameters will be of type FileTriggerScriptParameters.

TerminationWaitHandle

WaitHandle that can be used to wait for script termination

protected WaitHandle TerminationWaitHandle { get; }

Property Value

WaitHandle

Remarks

This handle is signaled when Terminate is called.

Methods

OnTerminate()

Called when the script is being aborted.

protected virtual void OnTerminate()

Remarks

Override to take additional actions when the script is aborted. Your script must complete any cleanup/shutdown actions within 10 seconds; after that the script will be forcibly terminated.

Run()

Runs the script.

public virtual object Run()

Returns

object

Remarks

This is the entry point called by adTempus when the script is run. Override to implement your script's logic. Use RunAsync instead if you need to run async code. You must override one of the two methods.

See Also

RunAsync()

Runs the script.

public virtual Task<object> RunAsync()

Returns

Task<object>

Remarks

This is the entry point called by adTempus when the script is run. Override to implement your script's logic if you need to use aync code.

If RunAsync is overridden, it is called in Run is ignored. You must override one of the two methods.

See Also