Transformer Pipeline Module API Reference  6.2.11.309924
Dynamic pipeline configuration

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...
 

Detailed Description

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.

Function Documentation

config.add_required_field ( 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.get_file ( )

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

Returns
Filename of the pipeline script
config.get_methods ( )

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.get_regex ( )

Get the regular expressions that are used by the pipeline.

Returns
A table containing details of the regular expressions
config.set_file ( 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 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.

Parameters
methods_table- 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:

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.

Parameters
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()

Generated on Sat Aug 26 2017 12:36:33 for Transformer Pipeline Module API Reference