One of the best features of Maximo is the Escalations app. An Escalation basically looks at conditions of a record in Maximo on a regular interval and if the condition(s) are met, triggers a notification or action to be fired off. The amount of heavy lifting that Escalations can do for a Maximo Administrator is unbelievable. So over the weekend I responded to a common question regarding Escalation timing in Maximo. From the Maximo Users Group on LinkedIn, Sun W. Kim asked the following:
I want to set up an escalation schedule to run hourly between the hours of 6AM to 6PM. Maximo allows me to schedule hourly, but it runs 24 hours a day. In Unix, you can set up cron jobs to run specific hours of day. In Maximo, the UI options do not allow for this.
Out of the box, Escalations are designed to run continuously on set interval. But there are valid business reasons to have an escalation only run during specific time spans. Several answers were given, but this is a breakdown of my solution - run two escalations.
Two Escalation Setup
The two escalation concept is simple:
- The first escalation does the action/notification you want to occur in Maximo.
- The second escalation controls the first escalation's active/inactive status.
The idea is to use Maximo's own monitoring process to manage when the first Escalation would fire. So in my example, I have two escalations:
The first escalation, 1098, is a basic notification escalation. The Escalation runs every 10 minutes to email me some information on the escalation itself.
This escalation could actually do any number of things - change a record status, update a value on a record, notify a user, etc. The goal of the first escalation should be only to make sure the required action or notification takes place. I don't worry about timing of when the escalation will run, beyond the interval I want the escalation to fire.
Just make sure the first Escalation is triggered under the appropriate conditions.
The second escalation, 1099, is the one that monitors the current time of day to set the active/inactive status of the first escalation.
The second escalation has 3 escalations points:
- Determine the time to set Escalation 1098 active.
- First point to determine the time to set Escalation 1098 inactive.
- Second point to determine the time to set Escalation 1098 inactive.
The reason I needed two Escalation Points to set Escalation 1098 inactive is because of the date/time validation change at midnight.
The SQL to set the escalation active runs from 6am to 6pm. An example of the Escalation Point time check for SQL Server is:
getdate() > dateadd(hour, +6, dateadd(day, 0, convert(varchar, getdate(), 101))) and getdate() < dateadd(hour, +18, dateadd(day, +1, convert(varchar, getdate(), 101)))
The normal reaction is to set the SQL in the Escalation Point to set Escalation 1098 inactive to be the reverse of the first a Escalation Point:
getdate() > dateadd(hour, +18, dateadd(day, 0, convert(varchar, getdate(), 101))) and getdate() < dateadd(hour, +6, dateadd(day, +1, convert(varchar, getdate(), 101)))
But the SQL to inactivate the escalation runs over two day span, so using the Escalation Point above won't work (I know, I tried). The inactivation Escalation Point needs to account for the day change, so the inactivation escalation points need to look from 6pm to midnight and midnight to 6am.
Escalation Point 2 looks at the time from 6pm to midnight:
getdate() > dateadd(hour, +18, dateadd(day, 0, convert(varchar, getdate(), 101))) and getdate() < dateadd(day, +1, convert(varchar, getdate(), 101))
Escalation Point 3 looks at the time from midnight to 6am:
getdate() > dateadd(day, 0, convert(varchar, getdate(), 101)) and getdate() < dateadd(hour, +6, dateadd(day, 0, convert(varchar, getdate(), 101)))
All three Escalation points end up looking like this:
Notice that the 2nd Escalation is monitoring a specific record in the Condition:
escalation = '1098'
Because the 2nd Escalation is not scanning for various conditions on the Escalation table, but using a system date/time check, there is a negligible performance hit on the system.
Escalation 1099 requires two 'Set Value' actions - one to set the escalation active (ESCALATION.ACTIVE = 1) and the other to set it inactive (ESCALATION.ACTIVE = 0):
Add these two Actions and apply them to the appropriate Escalation Point.
Activating Escalation Pair
Once both Escalations are setup, I can activate both of them and let them go to work. Escalation 1098 and 1099 were activated around 7pm last night. Shortly after activating both of them, Escalation 1098 was set to inactive. But this morning at 6am, I got the following email from Maximo:
So now I have an Escalation running from 6am to 6pm daily. If you want to have Escalation 1098 run from 6am to 6pm, Monday through Friday, then you need to add a 3rd Escalation to track what day of the week it is to activate/inactivate Escalation 1099, which in turn would activate/inactivate Escalation 1098.
Got any questions? Feel free to hit me up on Twitter at @MyGeekDaddy.