Table of Contents

Class ScriptLibrary

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

A library of reusable script code

public sealed class ScriptLibrary : ADTIndependentObject
Inheritance
object
ScriptLibrary

Properties

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.

IncludeLibraries

The Script Libraries referenced by this library

public ScriptLibraryCollection IncludeLibraries { get; }

Property Value

ScriptLibraryCollection

IsDefaultFunctionLibrary

Indicates whether this is the default function library

public bool IsDefaultFunctionLibrary { get; }

Property Value

bool

Remarks

The default function library has DefaultFunctionLibrary as its OID.

Methods in the default function library are available to be called as "inline functions" using the job variable token syntax.

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.

Name

The name of the library

public string Name { get; set; }

Property Value

string

Remarks

The Name is required and must be unique across all script libraries that use the same language. The Name must match the name of the class/module defined in the ScriptBody and therefore must be a valid name for the language.

References

List of assemblies referenced by the script.

public string References { get; set; }

Property Value

string

Remarks

For .NET scripts that need to reference additional assemblies, specify those assemblies here. The list should be comma-, semicolon-, or newline-delimited.

ScriptBody

The code for the library

public string ScriptBody { get; set; }

Property Value

string

Remarks

Each ScriptLibrary contains code that will available to Scripts that reference the library.

The code must be written in the language specified by the ScriptLanguage.

ScriptLanguage

The language used for this script

public string ScriptLanguage { get; set; }

Property Value

string

Remarks

Must be set to one of the string constants defined in ScriptLanguages.

Methods

DependsOnLibrary(OID)

Indicates whether the ScriptLibrary, or any of the libraries it references, has a reference to a given ScriptLibrary.

public bool DependsOnLibrary(OID libraryOID)

Parameters

NameTypeDescription
libraryOID OID

The OID of the library to check for.

Returns

bool

True if this library or any of its IncludeLibraries (or their dependencies) reference the given library, False otherwise.

Remarks

This method is used to detect circular library references

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.

ValidateScript(CredentialProfile)

Validates the script by compiling it and checking for errors.

public MessageCollection ValidateScript(CredentialProfile credentials)

Parameters

NameTypeDescription
credentials CredentialProfile

Optional CredentialProfile representing the identity to validate the script under. If no profile is provided, the client identity is used. The caller must have Use permission for the profile.

Returns

MessageCollection

A collection of messages containing any validation warning or errors. If validation was successful, an informational message will be included.

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