By Josh Tafoya, Technical Trainer
(This is the fifth in a series of training blogs about automating your account comments for faster alarm handling. Links to the other blogs in the series are available at the end.)
In our last training blog, we crossed off another item, changing the list of comments to what is shown above. For our next item (not calling on Late to Test more than once a week), I am going to be relying heavily (again) on work that Caryn Morgan has done previously.
As in the previous blog, we will need to query the database. Rather than repeating all the logic from last time, I will simply say to return the count of how many times in the last seven days someone was contacted, this is the query I need (with a little more information below):
(SELECT COUNT(*) FROM CLOG{0} WHERE SERIALNO={ME} AND STCODE=”*LT” AND LOGDATE>=DATEADD(DD,-7,”{DU}”) AND EVTYPE=3 AND QUAL=1 AND QUAL7=1) + (SELECT COUNT(*) FROM CLOG{1} WHERE SERIALNO={ME} AND STCODE=”*LT” AND LOGDATE>=DATEADD(DD,-7,”{DU}”) AND EVTYPE=3 AND QUAL=1 AND QUAL7=1)
New in this query are the references to EVTYPE of 3 and a QUAL of 1 and a QUAL7 of 1.
Of course, nobody is expected to know what these are off the top of their head. Even I need to look it up all the time. If you are going to be writing queries to select information from the Manitou database (like this, for example), please contact your sales representative to talk about what is involved in gaining access to the Manitou Database Dictionary.
- EVTYPE of 3 indicates that this is an Action line in the log (like contacting someone, for example).
- QUAL of 1 (based on the EVTYPE of 3) means that this is a Contact action.
- QUAL7 of 1 (based on the EVTYPE of 3 and the QUAL of 1) indicates that the operator selected CONTACTED when contacting someone. They didn’t select BUSY or NO ANSWER or any of the other choices.
So, our query is going to return a count, from this month (and last month, if last month is in the last 7 days), of how many times a LATE TO TEST alarm resulted in contacting someone from the contact list.
Next, we will need to log that information to the Activity Log so it is clear from the activity why more contacts were or were not attempted.
After that is logged, we need Manitou to decide how to proceed. If the count that is returned is one or more, we need to close out the alarm. Otherwise, we need to contact the Customer (or take another action) then close the alarm.
Since we are using IF/ELSE logic, we need to remember, also, to put an END IF command at the end of our logic section.
Our action pattern then, will most likely look like this:
- SET: @CHECK = SELECT (SELECT COUNT(*) FROM CLOG{0} WHERE SERIALNO={ME} AND STCODE=”*LT” AND LOGDATE>=DATEADD(DD,-7,”{DU}”) AND EVTYPE=3 AND QUAL=1 AND QUAL7=1)+ (SELECT COUNT(*) FROM CLOG{1} WHERE SERIALNO={ME} AND STCODE=”*LT” AND LOGDATE>=DATEADD(DD,-7,”{DU}”) AND EVTYPE=3 AND QUAL=1 AND QUAL7=1)
- LOG:CUSTOMER RECEIVED A NOTIFICATION IN THE LAST 7 DAYS. @CONTACTED
- IF @CHECK>=1
- CLOSE ALARM WITH RESOLUTION AU
- ELSE
- CONTACT CUSTOMER
- CLOSE ALARM WITH RESOLUTION __
- END IF
This is a relatively straightforward use of Enhanced Action Patterns but is exactly the type of thing that I was asked about for years before it was available.
Once again, I’d like to thank Caryn for the work she’s done on Enhanced Action Patterns and especially documenting these common scenarios.
Our list of comments continues to shrink! Now it looks like this:
One more to go to complete it! Check back next week as we finish up this blog training series.
This is the fifth in a series of training blogs discussing how to automate comments for better efficiency and fewer errors. See the previous entries here: