Macro Engine (ME) is an extension of the Jedox Web Core delivered in the form of an external library (.dll/.so), which gets loaded when Core loads. It is enabled by default but is not mandatory, meaning that Core will start even if this extension is disabled or if Core is unable to load it during the start procedure.
ME is called by the following entry in the file …\Jedox Suite\core\config.xml (Windows) or …/core-Linux-i686/etc/config.xml (Linux):
<extension name="macro_engine" config="macro_engine_config.xml" />
ME has different configuration options that are set in the file macro_engine_config.xml. These options are mainly various PHP statements, which are normally in the php.ini. Furthermore, included are the user-defined functions, which should be available server-wide. Note: to prevent users from writing custom macros for specific functions, you can disable those functions in macro_engine_config.xml. Use the parameter
disable_functions in the ini_directives section.
Note: Macro Engine scripts are written in PHP, and have to be compliant with the PHP version used by Macro Engine and Supervision Server, respectively. They also can make use of Jedox-specific PHP functions, which may be dependent on the Jedox version in use. New versions of Jedox may include new versions of PHP in these two components, and thus may require manual adjustment of script code. Additionally, scripts developed in and working with a current version of Jedox may not work in a previous version.
The following is an example of a macro_engine_config.xml:
<?xml version="1.0" encoding="utf-8"?>
<php_macro_engine_config xmlns="http://www.jedox.com/jedox/wss" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<extension extension_file="php_curl.dll" />
<extension extension_file="php_jedox_palo_x64.dll" />
<extension extension_file="phpchartdir560.dll" />
<php_files directory="php_macros" temp_directory="tmp" />
<include_path path="base" relative="true" />
<include_path path="lib" relative="true" />
memory_limit = 256M
max_execution_time = 90
max_input_time = 90
date.timezone = "Europe/Berlin"
open_basedir = "php_macros;tmp"
<function spreadsheet_function="RESOLVE" php_file="base/macro/fns/misc.php" php_function="RESOLVE" always_recalc="false" />
The sections of the configuration file are:
- php_extensions: used to define the path to PHP extensions used in ME; within this section you specify the files to be loaded when ME loads.
- php_files: used to specify relevant PHP directories, such as “temp” and “include”. You can specify more than one “include” directory path
- ini_directives: here you can specify general PHP settings. In standalone PHP, such settings are found in the file php.ini.
- functions: used to specify custom functions that will be available to every ME user. You have to specify the name of the function as it should be used in the spreadsheet, the path to the file that contains the definition for the function, and the internal name of the function.
The “always_recalc” flag controls whether the function should always be calculated (true), or only upon change in the value of arguments of the function (false).
Note: if you update from an older version to the latest version, you have to manually copy all custom libraries (files) from
../core/php_macros/lib(Windows) and from
See also Macro Engine.