Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Intermediate save

...

Excerpt Include
Monitors
Monitors
nopaneltrue

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.
    • A Pre-/Post-Processing Monitor can Monitors can be reused - i.e. included by multiple jobs. 
    • A Pre-/Post-Processing Monitor Monitors can implement unique features within JobScheduler by accessing the JobScheduler's API Interface
  • Feature Availabiliy
    • Jira
      serverSOS JIRA
      columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
      serverId6dc67751-9d67-34cd-985b-194a8cdc9602
      keyJS-1145
  • Example
    • In following example we will create a Pre-Processing Monitor to show that shows all the order parameters before start of the a job. In the following example addition, we will see that parameters created by one task are can be carried forward by the running 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.

Managing Monitors

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:

Image Added

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

Creating a Monitor using JOE

  • In the left navigation pan 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, e.g. process0.
  • Click on the name Name of the newly created Monitor: 
    • This will open a form allowing more configuration options such as name Name, ordering Ordering etc. to be set.
      • Click inside the name's Name text box and specify a relevant name for the Named Monitor a relevent name, e.g. show_all_order_parameters_pre.
      • Leave the Orderingto 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:

      Code Block
      languagejs
      titleshow_all_order_monitorsparameters_pre
      collapsetrue
      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.

...