Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Events
Question: How can I wait for an event in a job chain?
...
- Unzip all files of test_event.zip into the ./config folder of your active instance of the eventservice JobScheduler installation. After unzipping you will have all the objects needed to run the example in the live/test_events subfolder.
- Open the JS operations gui for the workload JobScheduler in your browser using http://scheduler_host:scheduler_port
- Find the {{
test_event/job chain_example_wait_for_event
}} job chain and click on it. - Click in the job chain menu on "add order"
- You see the order will run until the step 3 is reached. As the EVENT event does not exist, the order will wait for 10s and then check again.
- Switch to the tab Jobs.
- Find the {{
test_event/job_event_add
}} job chain and click on it. - In the Job menu press Start task immediately. This will create the EVENT event.
- Switch to the tab Job Chains.
- See the order proceeding with execution of the next step
...
The test_event/job chain_example_wait_for_event }} event
job chain has 2 dummy steps and the wait for event step. This step executes the {{ test_event/job_event_check
job to look for the desired event specified in the scheduler_event_spec parameter. As the events are stored in a xml object you have to specify a xpath expression here.
...
The test_event/job chain_example_wait_for_event_db }} db
job chain has 2 dummy steps and the wait for event step. This step executes the {{ test_event/job_event_check_db
job to look for the desired event. The difference to to first example is, that this job uses the events database. You can either specify parameters for event_id, event_class and exit_code to test for a specific event or you can specify a condition for the events you are waiting for.
example:
Code Block |
---|
class_a.event_1:99 and not (class_b.event2 or class_b.event3)
if the event_1 in class class_a exists with exit_code=99 and event2 and event3 from class_b do not exist, this expression evaluates to true.
|
You also can specify how to handle the existing or not existing of events with the paramters handle_existing_ah1. "error|success" or handle_not_existing_as"error|success"
example
Code Block |
---|
handle_existing_as=error will wait until the events do not exist
|
...