Unit
Initialize and shut down pipeline units using JavaScript.
Unit Initialization
Unit constructor() methods run when a pipeline unit starts, allowing for resource initialization, logging, and configuration.
export class FileOutput extends TenXOutput {
constructor() {
if (this.outputFilePath) {
if (this.outputFileWriteObjects != false) {
if (this.outputFileWriteTemplates) {
TenXConsole.log("Writing TenXObjects and TenXTemplates to: " + this.outputFilePath);
} else {
TenXConsole.log("Writing TenXObjects to: " + this.outputFilePath);
}
} else if (this.outputFileWriteTemplates ) {
TenXConsole.log("Writing TenXTemplates to: " + this.outputFilePath);
}
}
}
}
Options
Specify the options below to configure multiple Unit JavaScript:
| Name | Description |
|---|---|
| unitActionsClassName | JavaScript class name |
| unitActions | 10x JavaScript statements to execute |
| unitActionsFile | Declaring .js file |
unitActionsClassName
JavaScript class name.
| Type | Required | Names |
|---|---|---|
| String | ✔ | [unitActionsClassName, TenXUnitClassName] |
Specifies the JavaScript class name in which unitActions are defined.
unitActions
10x JavaScript statements to execute.
| Type | Default | Names |
|---|---|---|
| List | [] | [unitActions, TenXUnit] |
JavaScript statements for initializing target unit(s).
NOTE: This argument is not designed to be set directly, but instead by passing a .js launch file containing these statements nested within an TenXInput sub-class constructor as described above.
unitActionsFile
Declaring .js file.
| Type | Default | Names |
|---|---|---|
| String | "" | [unitActionsFile, TenXUnitFile] |
Specifies the .js file name declaring unitActions.
This unit is defined in unit/unit.yaml.