Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Status
colourYellow
titleUnder 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

...

Excerpt Include
Monitors
Monitors
nopaneltrue

Change Management References

Jira
serverSOS JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution,fixversions
maximumIssues20
jqlQueryissuekey in (JS-1145 ,JOE-117 )
serverId6dc67751-9d67-34cd-985b-194a8cdc9602

 

Pre-/Post-Processing

...

Monitors

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 by multiple jobs. A Pre-/Post-Processing Monitor can implement unique features within JobScheduler by accessing JobScheduler's API. 

In following example we will create a prePre-processing monitor Processing Monitor to show  all all the order parameters before any start of the job stated. In the following example we will see that parameters created by one Task task are carried forward by the running Order order to the next Task. First Job The first job JobA will create two parameters BOOKINGD_DATE and START_TRX_ID , which  which will be carry carried forward by the Order order to the next Job job JobB .

...

Creating a Pre-/Post-Processing Monitor

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

    • Copy past & Paste the following code snippet between as a replacement for the function:

      Code Block
      languagejs
      titleshow_all_order_monitors
      collapsetrue
      function spooler_process_before() {
        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 total number of Orderorder parameters : " + parameters.count() );
      
        spooler_log.info( "   " );
        var names = parameters.names().split(" ';"' );
          for( i=0; i < parameters.count(); i++ ) {
              spooler_log.info( "     .. parameter: "+ names[i] + "  = " + parameters.value( names[i] ) );
          }
        spooler_log.info( "   " );
        spooler_log.info( "   End Monitor : show_all_order_params" ); 
        return true;
      }
    • Save the configuration by clicking on Save Configuration.

...

Assigning a Pre-/Post-Processing

...

Monitor

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

Instruction Video