Before using functions written in the Python language, make sure that there is integration of Python and Foresight Analytics Platform.
To call the functions written in the Python language, use the Invoke system function. Syntax of the Invoke function:
Invoke("ModuleName","FunctionName",Param1,Param2,…,ParamN)
Where:
ModuleName. Unit name that contains function.
FunctionName. Function name.
Param1,Param2,…,ParamN. Function parameters enumerated via comma. They are not specified, if the function being called does not contain any parameters.
To call Python functions without parameters, the Invoke function has the following syntax:
Invoke("ModuleName","FunctionName",Null)
On calling the Python functions, take into account the following features:
Unit name and function name are case-sensitive. Unit name is determined without .ru extension.
The unit where function is located must be copied to the Foresight Analytics Platform installation folder or must be imported to the Python library.
Function parameters and the result returned by the function must have one of the following data types: Null, Boolean, Integer, Double, Decimal, String. Note that Decimal can be applied only to the result returned by the function.
If input and output operations are used in the module, then use the mechanism of critical sections for them.
TIP. For details on writing functions in the Python language and on import of modules into the Python library, see Python documentation.
See also: