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

Compare with Current View Page History

« Previous Version 20 Next »

Introduction

Monitors (also called Pre-/Post-Processing Monitors) are used with Jobs to provide pre-processing and post-processing capabilities by Scripting. Pre-Processing Monitors are executed before a task or processing step is executed by the JobScheduler. Similarly Post-Processing Monitors are executed once a task or processing step has been completed. 

  • Jobs can have multiple Pre-/Post-Processing Monitors. The order in which these are executed by the JobScheduler can be specified by setting a parameter.
    • Pre-Processing Monitors can be created to 
      • validate required conditions for a particular task to be started or 
      • set a parameter value dynamically, e.g. today's date.
    • At the same time Post-Processing Monitors can check the job's execution status, return code, total execution time etc..
  • Pre-/Post-Processing Monitors can be programmed independently of a job's programming language. For example, a shell script job can have a Pre-/Post-Processing Monitor written in JavaScript. 

Named 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 by multiple jobs. 
    • A Pre-/Post-Processing Monitor can implement unique features within JobScheduler by accessing JobScheduler's API. 
  • Feature Availabiliy
    • JS-1145 - Getting issue details... STATUS
  • Example
    • In following example we will create a Pre-Processing Monitor to show all the order parameters before start of the job. In the following example we will see that parameters created by one task are carried forward by the running order to the next task. The first job JobA will create two parameters BOOKINGD_DATE and START_TRX_ID which will be carried forward by the order to the next job JobB.

Managing Monitors

Creating a Pre-/Post-Processing Monitor

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

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

      show_all_order_monitors
      function spooler_process_before() {
      
          var parameters = spooler_task.order().params();
          spooler_log.info( ".. total number of order parameters: " + parameters.count() );
      
          var names = parameters.names().split( ';' );
          for( i=0; i < parameters.count(); i++ ) {
              spooler_log.info( ".. parameter: "+ names[i] + " = " + parameters.value( names[i] ) );
          }
      
          return true;
      }
    • Save the configuration by clicking on Save Configuration.

Assigning a Pre-/Post-Processing Monitor

  • The same Pre-/Post Processing Monitor can be used by a number of jobs.
  • Click on the job you want to use the Pre-Processing Monitor show_all_order_parameters with.
  • Expand the job configuration options by clicking on the left side of the job.
    • Click on the option Monitors used  that will open the 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 to the Ordering text box.
    • Click "Apply Monitor Use".
    • Save the configuration by clicking on Save Configuration.

Instruction Video



References

Change Management References

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

See also

 

  • No labels