Dependencies of job chains implemented by events
One of the methods to implement dependencies between job chains is using event handlers. Whenever an event is created an entry is made into the data base table scheduler_events. In the event handler the conditions are defined to add an order for the job chain to be started.
Events are processed by a JobScheduler Instance. This could be a Supervisor JobScheduler if a Workload JobScheduler is registered with that instance otherwise the Workload JobScheduler is used.
The events can be monitored with the JOC Cockpit web interface, which replaces the JID - JobScheduler Information Dashboard interface which is deprecated as of JobScheduler Release 1.12.0.
Event Service
Before events can be used the event service has to be installed. It is part of the JobScheduler installation if configured within the installation procedure.
The Event Service can also be installed in an existing JobScheduler instance. For more information see How to install the Event Service feature in JobScheduler.
The job chain scheduler_event_service is running in predetermined intervals or whenever an event is created. The event service checks all .xml
data files in the $SCHEDULER_DATA/config/events
folder for information matching the active events which are stored in the database table . All job chains within the actual live folder may be concerned.
Event handler
The event handler is a .xml data file which contains the definitions of the events and the commands which are triggered .
For each job chain started by events we need an action to be defined in the event handler. An action has the two parts:
- Events ("if-clause")
- Command ("then-clause")
An event is uniquely defined by event class and event ID. Together with and/or/not the events of a group are combined to the condition.
In the command part the Order is defined to start the Job Chain as soon as the condition becomes true
. It is also possible to use the add event command to create new events.
Every event which is used in the condition has to be deleted from the database with the remove event command .
Handling events in jobs / job chains
As part of the JobScheduler installation there are some Java classes to handle events:
- JobSchedulerSubmitEventTaskAfterMonitor
- JobSchedulerSubmitEventMonitor can be configured as a monitor for (not shell-) jobs to submit an event.
- JobSchedulerSubmitEventMonitor can be configured as a monitor for (not shell-) jobs to submit an event.
- JobSchedulerSubmitEventJob
- JobSchedulerSubmitEventJob can be configured to submit an event.
- JobSchedulerSubmitEventJob can be configured to submit an event.
- JobSchedulerDequeueEventsJob
- Dequeues Events. This job is triggered by orders or by standard job starts.
- Dequeues Events. This job is triggered by orders or by standard job starts.
- JobSchedulerExistsEventJob
- This job checks if certain event exists. The job processes orders which are configured with an event specification. Depending on whether these events exist or not the order will be put into the next_state or into the error_state.
- This job checks if certain event exists. The job processes orders which are configured with an event specification. Depending on whether these events exist or not the order will be put into the next_state or into the error_state.
- JobSchedulerCheckEvents
- Check if events exist. This job is executed order driven.
- Check if events exist. This job is executed order driven.
- JobSchedulerEventJob
- Process events. This job is executed order driven
Documentation
For more information about eventing see the reference guide JobScheduler Events, Definition and Processing