Skip to content

Template

Defines shared static members accessible by all instances of a template.

Example: calculating severity from symbol values (Debug, Traceback most recent call last):

export class LevelTemplate extends TenXTemplate {

    constructor() {

        // check the template's symbol value starts with any of the configured 'levelTerms' values
        // use the map function to get the level value associated with a matching term

        LevelTemplate.level = TenXString.startsWith(
            this.symbolSequence("", "log", 30), 
            TenXMap.fromEntries(TenXEnv.get("levelTerms"))
        );
    }
}

Options

Specify the options below to configure multiple Template JavaScript:

Name Description
templateClassName Target inputs of TenXObjects to initialize
templateActions 10x JavaScript template initialization statements to execute
templateActionsFile Declaring .js file

templateClassName

Target inputs of TenXObjects to initialize.

Type Required Names
String [templateClassName, TenXTemplateClassName]

Specifies a regex pattern (e.g., ^fluentbit) a target input name must match for.

templateActions

10x JavaScript template initialization statements to execute.

Type Default Names
List [] [templateActions, TenXTemplate]

JavaScript statements for initializing target input(s) TenxTemplates.

NOTE: This argument is not designed to be set directly, but instead by passing a .js launch file containing these statements nested within an TenXObject sub-class constructor as command line argument as described above.

templateActionsFile

Declaring .js file.

Type Default Names
String "" [templateActionsFile, TenXTemplateFile]

Specifies the .js file name declaring templateActions.


This unit is defined in template/unit.yaml.