Start an ETL Job From a Report

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Start an ETL Job From a Report

    Hi

    i try to run job from Report by button i use that script and its not working


    require library('integrator');

    function _start_ETL_Job ()
    {
    $ws = activesheet(); // get activesheet
    $project = $ws->range('U2')->value; // i put here the name of the project as it show in the model
    $job = $ws->range('U3')->value; // i put here the name of the job as it show in the integrator
    $id = integrator_start_job($project,$job);
    }
  • Hey there,

    were the job executed in the jedox integrator (look at the monitor) or did it not start at all?
    Does the script return an id-number? (add: return __msgbox('Job started with id '.$id,'info'); )

    You may also reduce the problem and do not use spreadsheet variables - so we can exclude this as the problem. ($id = integrator_start_job('test_projekt','test_job'); )

    Best
    Gerwin
  • Thanks Gravin for all the help:)

    Q: Is the work performed in the jedox integrator (look at the monitor) or did it not start at all?

    A: Yes at work the monitor integrator show me this done (all green) and I check in the report and it's do what is supposed to do.

    The number that show on the monitor is id 602

    Q: Does the script return an id-number? (add: return __msgbox('Job started with id '.$id,'info'); )

    N: Yes, its good if it will returan the id

    you mean like that:

    function _start_ETL_Job ()
    {

    $project = activesheet()->range('U2')->value; // i put here the name of the project as it show in the model
    $job = activesheet()->range('U3')->value; // i put here the name of the job as it show in the integrator
    $id = integrator_start_job($project,$job);
    }
  • "A: Yes at work the monitor integrator show me this done (all green) and I check in the report and it's do what is supposed to do."

    When you can see, that the job is done in the integrator and it does return an id, what is not working then? :-/

    Also, try this code please. It should return a valid id in a popup field.

    function _start_ETL_Job ()
    {

    $project = activesheet()->range('U2')->value; // i put here the name of the project as it show in the model
    $job = activesheet()->range('U3')->value; // i put here the name of the job as it show in the integrator
    $id = integrator_start_job($project,$job);
    return __msgbox('Job started with id '.$id,'info');

    }
  • its working thanks :)

    but there is a way that the Code will just run only on the spastic variables.
    i mean only what its show on the screen.

    for example when i click on the button run it just do the job only for the element that i chose

    there is example attached.

    thanks!
    Images
    • Untitled.png

      4.84 kB, 954×106, viewed 19 times
  • $project = activesheet()->range('U2')->value;

    this returnthe name of the project

    $job = activesheet()->range('U3')

    and this return the name of the job

    i try this but its faild:

    require library('integrator');

    // for starting an ETL Job

    function _btn_start_job_Click ()
    {
    $ws = activesheet(); // get activesheet
    $project = $ws->range('U2')->value; // cell where Project name should be retrieved from
    $job = $ws->range('U3')->value; // cell where Job name should be retrieved from
    $status = $ws->range('U5')->value; //cell where status is written to
    $Jurisdiction = retrieve_variable("Jurisdiction");
    $Region = retrieve_variable("Region");
    $Company = retrieve_variable("Company");
    //start the Job given in cell C15 (via Combobox) in Integrator project given in cell C14 (via Combobox)
    $id = integrator_start_job($project,$job,$Jurisdiction,$Region,$Company);
    //assign the return job id to a @variable
    // get the status code and message (array) of the job
    $status = integrator_set_job_status($id);
    //write job id in cell
    $returnid = $id;
    $ws->range('U6')->value = $returnid; //cell where Job ID should be returned to
    // write job status in cell
    $ws->range('U5')->value = $status;
    //show the returned job id in a message box
    return __msgbox('Job gestarted mit ID '.$id,'info');
    }
  • Good morning,

    you need to use a php-array element to pass variables.

    Like this $variables = array(array('name' => 'name_variable_1','value' => 'value_variable_1'),array('name' => 'name_variable_2','value' => 'value_variable_2'),...array('name' => 'name_variable_n','value' => 'value_variable_n'));

    This is, how your code may should look like:

    #########################PHP#######################################

    function _btn_start_job_Click ()
    {
    $ws = activesheet(); // get activesheet
    $project = $ws->range('U2')->value; // cell where Project name should be retrieved from
    $job = $ws->range('U3')->value; // cell where Job name should be retrieved from
    $status = $ws->range('U5')->value; //cell where status is written to
    $Jurisdiction = retrieve_variable("Jurisdiction");
    $Region = retrieve_variable("Region");
    $Company = retrieve_variable("Company");


    $variables = array(array('name' => 'Jurisdiction','value' => $Jurisdiction),array('name' => 'Region','value' => $Region),array('name' => 'Company','value' => $Company));
    //start the Job given in cell C15 (via Combobox) in Integrator project given in cell C14 (via Combobox)
    $id = integrator_start_job($project,$job,$variables);


    //assign the return job id to a @variable
    // get the status code and message (array) of the job
    $status = integrator_set_job_status($id);
    //write job id in cell
    $returnid = $id;
    $ws->range('U6')->value = $id; //cell where Job ID should be returned to
    // write job status in cell
    $ws->range('U5')->value = $status;
    //show the returned job id in a message box
    return __msgbox('Job gestarted mit ID '.$id,'info');
    }

    ###################################################

    Best
    Gerwin