|
Transformer Pipeline Module API Reference
8.0.9.562131-6357b6d3
|
![]() |
The methods in this package provide access to the configuration of a pipeline script.
These methods operate on a config object as returned by system_get_pipeline() As a result, the colon (':') operator should be used.
Functions | |
| config.set_methods (var methods_table) | |
| Set the methods that should be used to implement the event callbacks. More... | |
| config.get_methods () | |
| Get the methods that should be used to implement the event callbacks. More... | |
| config.set_regex (var regex_table) | |
| Set the regular expressions that are used by the pipeline. More... | |
| config.get_regex () | |
| Get the regular expressions that are used by the pipeline. More... | |
| config.set_file (var filename) | |
| Set the file that contains all the event callbacks. More... | |
| config.get_file () | |
| Get the filename of the file that contains the event callbacks. More... | |
| config.commit () | |
| Commit and activate a configuration. More... | |
| config.clear_required_fields () | |
| Clear all the required fields for the pipeline. See required-fields. | |
| config.add_required_field (var field) | |
| Add a new required field to the pipeline. See required-fields. More... | |
| config.add_required_field | ( | 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.get_file | ( | ) |
Get the filename of the file that contains the event callbacks.
| config.get_methods | ( | ) |
Get the methods that should be used to implement the event callbacks.
| config.get_regex | ( | ) |
Get the regular expressions that are used by the pipeline.
| config.set_file | ( | 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 set_methods() method), it is not possible to implement different callbacks in different script files for the same pipeline.
| config.set_methods | ( | var | methods_table | ) |
Set the methods that should be used to implement the event callbacks.
| methods_table | - 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:
local config = system.get_pipeline("example")
-- Retrieve the current methods, and modify the update callback
local methods = config:get_methods()
methods.update = "new_update_function"
config:set_methods(methods)
-- Commit and activate the new configuration
config:commit()
| config.set_regex | ( | var | regex_table | ) |
Set the regular expressions that are used by the pipeline.
| regex_table | - 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:
local config = system.get_pipeline("example")
-- Retrieve the current methods, and modify the update callback
local regex = config:get_regex()
regex["^/L"] = "listener-include"
config:set_regex(regex)
-- Commit and activate the new configuration
config:commit()