- place specific jobs on hold when an unrelated Process Server is unavailable (not in a Running State).
- Send out an alert when the Jobs are placed on hold.
- Release the Jobs when the unrelated Process Server is available again.
- send an alert when Jobs are released.
The Alerting Module can be used to implement the above requirements.
Attached is a car-file with an example application that contains the below implementation.
Any code referenced in the screenshots below is also part of that car-file.
The minimum set of Objects required is described below:
- Event Definition
This Event Definition will be raised/cleared by the Process Server Alert Source.
All jobs dependent on the Process Server (remote System) must have a Wait Event set for this Event Definition.
The critical part is that the Jobs are not allowed to Clear the Event.
- Process Server Alert Source
This is the Trigger point for the Process Server Status change.
Set the Process Server(s) you want to trigger for and the alias that will be picked up by the Email Alert Gateway to send the Alerts to.
Then indicate the Statuses for the Alert to trigger on the Statuses Tab.
Statuses to be added should be at the minimum:
- Partially Running
- Then on the Action tab is the magic that raises and clears the event (and discards the Operator Message)
The code itself is basic. It does not contain any indicators when, for example, the Event Definition is not found. The Event Definition Partition and name are hardcoded in the code, see below highlighted sections
- Email Alert Gateway
This Object will send out Alert Emails for each Status Change.
This does mean that when you have both statuses Starting and Partially Running in your Process Server Alert Source, you will get 2 emails during a Start (from "Starting -> Partially" Running and "Partially Running -> Running".
Indicate the Alias to pick up the Process Server Alert Source Alerts.
Then Set the Headers to ensure the Alert informs the correct people.
To ensure the Email has a proper Subject, I changed it here to indicate that the Process Server has changed Status.
We should also change the body of the Email to indicate more details about what happened.
You must change the highlighted section to match your RMJ URL. This is environment specific. Otherwise, the link in the Email will not work.
Remove the entire Link HTML tag (lines 8 and 9) from the email if you do not need the link.
The remaining Objects in the Car file are for testing only:
- Application Ticket_43238_AlertOnProcessServerFailure -> Groups everything together in the UI
- Queue Ticket_43238_Queue -> Run the Job in this Queue. You only need to Add the Process Server System here.
- Submit Frame Ticket_43238_SubmitFrame_Every5Min -> makes the Test Job run periodically.
- Job Definition Ticket_43238_TestJob -> Testing the functionality
To run a Test with the above example:
- Change the Email Address in the Email Alert Gateway
- Add the Process Server System to the Queue Ticket_43238_Queue
- Change the Process Server name in the Process Server Alert Source to match the Process Server you will be testing with
- Submit the Test Job with the Submit Frame.
- Start/Stop the Process Server chose the test with.
- Observe the results.
I ran the Process and stopped the testing Process Server several times.
When the Process Server is stopped the Event is Cleared stopping all jobs that depend on the Event Definition.
Each time the Process Server changes back to Running, a new Event will be generated.
This will allow the Job Schedules dependent on the Event Definition to continue as a Raised Event again exists.
I highlighted the different Event IDs in the screenshot below.
The red X for the Scheduled Job indicates that there is no Raised Event and that the Job will not start.
I have highlighted it at the top of the screenshot.
Once the issue with the Process Server is resolved, the Event will be raised.
The waiting Job would start immediately if it passed its scheduled start time.
Please take a look at the highlighted Start Times for such a situation.