You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

 

UNDER PROGRESS

Introduction

The Monitors (also called Pre-/Post-Processing Monitors) are used with jobs to provide pre-processing and post-processing capabilities by scripting. The pre-/post-processing monitors are executed before a Task is being executed by the JobScheduler. Similarly the Post-processing monitors are executed once a Task is finished. 

A Job can have multiple Pre-/Post-Processing Monitors ordered starting from 0 onward to be executed by the JobScheduler. A Pre-Processing Monitor can be created to validate a required condition for a particular task to be started or set a parameter value e.g. today's date etc. At the same time a Post-Processing Monitor can check the job's execution status return code. total execution time etc. The Pre-/Post-Processing Monitors can be programmed independent from the job's programming language e.g. a Shell Script job can have a Pre-/Post-Processing Monitor written in the Javascript. 

Issues

The Named Monitor feature is subject to the following issues

Key Summary T Created Updated Due Assignee Reporter P Status Resolution Fix Version/s
Loading...
Refresh

 

Pre-/Post-ProcessingMonitor

The Pre-/Post-Processing Monitors are generic block of code stored in the separate file with file extension *.monitor.xml e.g. MyMonitor.monitor.xml. A Pre-/Post-Processing Monitor can be included in multiple jobs. A Pre-/Post-Processing 

In following example we will create a pre-processing monitor to show  all the order parameters before any job stated. 

Create Pre-/Post Monitor

  • In the left navigation pan Click on the Pre-/Post-Processing 
  • In the far right top side click on New to create a Pre-/Post-Processing monitor
    • New Monitor will be created with a default name e.g. process0
  • Click on the newly created monitor e.g. name process0
    • This will open more configuration option such as name, ordering etc
      • Click inside the Name's text box and give the Named monitor a relevent name eg. show_all_order_parameters
      • Leave the Ordering to default 0
      • Chose the Language javax.script.ecmascript from the dropdown menu.
    • Just below of Click on the script tab and chose spooler_process_before() code snippet

    • Copy past following code snippet between the function (TBD)

      show_all_order_monitors
       spooler_log.info( "   " );
        spooler_log.info( "   Start Monitor : show_all_order_params" );
        var parameters = spooler_task.order().params();
        if( parameters.count() > 0 ){
            spooler_log.info( "      Order parameters given" );
            } else {
            spooler_log.info( "      No Order parameters given" );
        }
        spooler_log.info("      Total number of Order parameters : " + parameters.count());
        spooler_log.info( "   " );
        var names = parameters.names().split(";");
        for( i=0; i < parameters.count();i++ ){
            spooler_log.info("      "+ names[i] + "  = " + parameters.value( names[i] ));
        }
        spooler_log.info( "   " );
        spooler_log.info( "   End Monitor : show_all_order_params" ); 
    • Save the configuration by clicking on Save Configuration.

Assign Pre-/Post Processing as Monitor

  • One Pre-/Post Prcocessing Monitor can be used by multiple jobs.
  • Click on the job you want to include the pre-processing monitor show_all_order_parameters into
  • Expand the job configuration options by clicking on left side of the job
    • click on the option Monitors used  this will open left side pan to assign a Pre-/Post Processing monitor
    • click on the button "New Monitor Use" 
    • select the monitor show_all_order_parameters from the Monitor drop down list. 
    • Assign an Ordering sequence 1 into Ordering text box
    • and last click "Apply Monitor Use"
    • Save the configuration by clicking on Save Configuration.

 

 

 

 

 

 

 

 

 

  • No labels