How Functions Work

Functions can be used on nodes and fields of the destination structure. Functions in Lobster_data are basically like functions of a programming language. They have input parameters and a return value and are be able to perform certain operations. However, no programming skills are necessary.

It is also possible to subsequently execute several functions on the same destination field (or node). We call that a function chain.

A function can have 1 to n input parameters. The following types are available.

  • Value. Simply numbers and/or letters. You can also use constants in the syntax %CONST_NAME%.

  • Variable. The name of a variable. The parameter value will then be the value of the variable.

  • Result. The position of a function in a function chain that is called before this function. The parameter value will be the return value of the function with the specified position number.

  • Link. The value of the source field mapped to this destination field.

  • Source field. The name of a field of the source structure. The parameter value will be the value of the source structure field.

  • Target field. The name of a field of the destination structure. The parameter value will be the value of the destination structure field.

Note: If a destination structure field uses another destination structure field as the input parameter for one of its functions, pay attention to the order of the destination structure fields. The destination structure field that uses the other destination structure field as a parameter value, must be below this other field in the destination structure. Otherwise, the destination structure field that is used as the input parameter, would have no value, since the fields of the destination structure are processed from top to bottom.

Note: There is also a way to work around the processing order. See section Using Future Values.

Order of Value Assignments to Destination Structure Fields (and Destination Structure Nodes)

  1. The mapped value (if there is one).

  2. The return value of a function (if there is one). For function chains, always the return value of the last function in the chain is used.

  3. Fixed value of the destination structure field (if there is one).

The subsequent value assignment always overwrites the previous one. That is, if a destination structure field has a fixed value, then the mapped value of this destination structure field and the return value of a function on the destination structure field is overwritten.

Note: In principle, this also applies to nodes in the destination structure, but there are no mapped values and no fixed values, so only return values of functions.

Effect of Functions on Destination Structure Nodes

The return value of a function on a destination structure node can be used to control whether the node is entered during the mapping and therefore whether it is generated in the destination tree or not. This is a very helpful technique to control the construction of the destination tree in the mapping process.

If the return value is true (resp. a string that begins with a t or a number > 0), the destination structure node is entered and thereby the destination tree node is created.

If the return value is false (resp. a string that does not begin with a t or a number <= 0), the destination structure node is not entered and thereby the destination tree node will not be created.

Note: See also data type Boolean.

Note: The return value can be a Boolean return value of a function (or a function chain) or simply the string true or 1, as the return value of the function copy(field/value/variable).

List of All Functions

A list of all available functions can be found here.

Security - Defining Access Restrictions

It is possible to restrict the allowed directories (whitelist) functions can access in the local file system in a properties file ./etc/admin/datawizard/whiteListPaths.properties.

You must enter the absolute paths that are allowed (subfolders are included). Example:

/home/demo
/opt/IS/conf

Note: This list also applies to the time-driven Input Agent File and the Response Route File.

Note: The access to configuration files and SMB shares is not affected by this list.

Security - Defining Function Restrictions

It is possible to disable certain functions in the GUI. Disabled functions will not be displayed in the function list. For this purpose, the IDs of the functions to be disabled must be specified in the configuration file ./etc/admin/datawizard/excludedFilter.properties. You can see the ID via the context menu of a function in the function list. You could, for example, disable functions that are able to access the local file system.

images/download/thumbnails/21305720/function_ID_EN-version-1-modificationdate-1529559115000-api-v2.png

GUI

See section Functions (GUI).