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.
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
- 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 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 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
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.
- A new Monitor will be created with a default name, e.g.
- 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:
Save the configuration by clicking on Save Configuration.
- This will open more configuration options such as name, ordering etc.
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