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

Compare with Current View Page History

« Previous Version 22 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. 

A short introduction to JobScheduler Monitors in general can be found in our Monitors article.

Named Pre-/Post-Processing Monitors

  • Named Monitors are Pre-/Post-Processing Monitors that are specified in the configuration of individual jobs.
    (Monitors can also be specified in the configuration of the executing JobScheduler as Enforced Monitors.)
  • Pre-/Post-Processing Monitors are generic blocks of code stored in separate files in the JobScheduler's live folder with file extension *.monitor.xml, e.g. MyMonitor.monitor.xml.
    • Pre-/Post-Processing Monitors can be reused - i.e. included by multiple jobs. 
    • Pre-/Post-Processing Monitors can implement unique features within JobScheduler by accessing the JobScheduler's API Interface
  • Feature Availabiliy
    • JS-1145 - Getting issue details... STATUS
  • Example
    • In following example we will create a Pre-Processing Monitor that shows all the order parameters before start of a job. In addition, we will see that parameters created by one task can be carried forward by the executing 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.

Creating a Named Pre-/Post-Processing Monitor using JOE

In following example we will create a Pre-Processing Monitor that shows all the order parameters before start of a job. In addition, we will see that parameters created by one task can be carried forward by the executing order to the next task. A 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.

Creating a job chain and order for the example

This example uses a simple job chain and order to demonstrate the configuration of a Named Monitor.

Download the example configuration.

We recommend downloading the example configuration and unpacking the configuration in your JobScheduler's live folder.

Opening the configuration in the JobScheduler's Object Editor, JOE, will show the file structure illustrated in the left hand pane of the following screenshot:

  • The Order1_0 has one parameter, orderParameter, with the value 1.

Creating a Monitor using JOE

  • In the left navigation pane 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, process0.
  • Click on the Name of the newly created Monitor: 
    • This will open a form allowing more configuration options such as Name, Ordering etc. to be set.
      • Click inside the Name text box and specify a relevant name for the Monitor, e.g. show_all_order_parameters_pre.
      • Leave the Ordering at the default value of 0.
      • Chose the script language java:javascript from the Language 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_parameters_pre
      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