Transformer Pipeline Module API Reference (JavaScript)  8.0.2.290852-a608fcd3
Dynamic pipeline configuration

Detailed Description

The methods in this package provide access to the configuration of a pipeline script.

Functions

 config.setMethods (var methodsTable)
 Set the methods that should be used to implement the event callbacks. More...
 
 config.getMethods ()
 Get the methods that should be used to implement the event callbacks. More...
 
 config.setRegex (var regexTable)
 Set the regular expressions that are used by the pipeline. More...
 
 config.getRegex ()
 Get the regular expressions that are used by the pipeline. More...
 
 config.setFile (var filename)
 Set the file that contains all the event callbacks. More...
 
 config.getFile ()
 Get the filename of the file that contains the event callbacks. More...
 
 config.commit ()
 Commit and activate a configuration. More...
 
 config.clearRequiredFields ()
 Clear all the required fields for the pipeline. See required-fields.
 
 config.addRequiredField (var field)
 Add a new required field to the pipeline. See required-fields. More...
 

Function Documentation

config.addRequiredField ( var  field)

Add a new required field to the pipeline. See required-fields.

Parameters
field- Name of field to add
config.commit ( )

Commit and activate a configuration.

Returns
status, errmsg

If status == 0, then the operation has succeeded. If status == -1, then the operation has failed and errmsg will contain a status string.

This function will causes a configuration to take effect.

config.getFile ( )

Get the filename of the file that contains the event callbacks.

Returns
Filename of the pipeline script
config.getMethods ( )

Get the methods that should be used to implement the event callbacks.

Returns
The method table for the pipeline
Note
This method is not officially supported at present
config.getRegex ( )

Get the regular expressions that are used by the pipeline.

Returns
A table containing details of the regular expressions
config.setFile ( var  filename)

Set the file that contains all the event callbacks.

Parameters
filename- Filename of the pipeline script

The filename is applied to all the methods (as configured using the setMethods() method), it is not possible to implement different callbacks in different script files for the same pipeline.

config.setMethods ( var  methodsTable)

Set the methods that should be used to implement the event callbacks.

Parameters
methodsTable- Table of methods
Returns
Note
This method is not officially supported at present

The table of methods can contain the following members:

table.initialise
table.update
table.nodata
table.status
table.request
table.discard

Thus to set the update callback on the pipeline named "example", the following code snippet could be used:

var config = system.getPipeline("example");

// Retrieve the current methods, and modify the update callback
var methods = config.getMethods();
methods.update = "newUpdateFunction";
config.setMethods(methods);

// Commit and activate the new configuration
config.commit();
config.setRegex ( var  regexTable)

Set the regular expressions that are used by the pipeline.

Parameters
regexTable- Table of regular expressions

The table should comprise of key/value pairs where the key is the regular expression and the value is one of the following: "listener-include", "listener-exclude", "provider-include" and "provider-exclude".

For example, the following snippet will reconfigure the "example" pipeline so that is additionally accepts symbols within /L hierarchy:

var config = system.getPipeline("example");

// Retrieve the current methods, and modify the update callback
local regex = config.getRegex();
regex["^/L"] = "listener-include";
config.setRegex(regex);

// Commit and activate the new configuration
config.commit();

Generated on Wed Jul 31 2024 18:00:29 for Transformer Pipeline Module API Reference (JavaScript)