|
Transformer Pipeline Module API Reference (JavaScript)
8.0.9.562131-6357b6d3
|
![]() |
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... | |
| config.addRequiredField | ( | var | field | ) |
Add a new required field to the pipeline. See required-fields.
| field | - Name of field to add |
| config.commit | ( | ) |
Commit and activate a configuration.
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.
| config.getMethods | ( | ) |
Get the methods that should be used to implement the event callbacks.
| config.getRegex | ( | ) |
Get the regular expressions that are used by the pipeline.
| config.setFile | ( | var | filename | ) |
Set the file that contains all the event callbacks.
| 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.
| methodsTable | - Table of methods |
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.
| 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();