Accessing Jedox Integrator from PHP

In Jedox Web reports, Integrator jobs can be started via Actions. If you cannot use Actions, you can also start Integrator jobs via Macros. To access Jedox Integrator and, for example, execute Integrator projects from the Macro Engine in Jedox Web spreadsheets, you can use two special wrapper functions , which are described below.

Integrator jobs can also be triggered with OData. See Jedox OData Hub Overview for more information.

Wrapper functions for accessing Jedox Integrator

To use the wrapper function, the macro code first requires the "integrator" code library. This is done to avoid integration of the code in macros that do not actually use it.

The library is required with this code:

Copy
require library('integrator'); 

inntegrator_start_job

To execute a specific job, the function "integrator_start_job" can be called. In its simplest form, this function expects the name of a project and the name of a job in that project as parameters:

Copy
$id = integrator_start_job('sampleBiker','default'); 

First, the function will check if the job is already running at the moment. If this is the case, it will exit with a message indicating so. If this is not the case, then the function immediately returns the Job ID of the executed job. Additionally, the function offers a set of optional arguments that allow modifying its behavior.

integrator_set_job

This function retrieves the status of a job (identified by its execution ID), and sets it to some resource in the spreadsheet, such as a cell or an @variable.

Copy
// retrieve the job id from its resource (has to be set beforehand)
$id = retrieve_variable('INTEGRATOR_JOB_ID');
  
// get the status code and message (array) of the job
$status = integrator_set_job_status($id); 

The function returns an array with the two fields: "status_code" and "status_message".

Details on wrapper functions can be found in the overview of the functions and objects exposed to the Macro Engine.

Updated March 19, 2024