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.
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
- 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 parametersBOOKINGD_DATE
andSTART_TRX_ID
which will be carried forward by the order to the next jobJobB
.
- 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
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.
- A new Monitor will be created with a default name,
- 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:
Save the configuration by clicking on Save Configuration.
- This will open a form allowing more configuration options such as Name, Ordering etc. to be set.
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
See also
- Monitors
- How to configure an Enforced Monitor
- How to add conditions for job execution with date calculation