Rob_Fetterhoff_1512

Set :WAIT timer to whatever the difference of a set time to the current time

Discussion created by Rob_Fetterhoff_1512 on Nov 24, 2014
Latest reply on Nov 25, 2014 by Rob_Fetterhoff_1512
Just figured this out for a project I'm putting together and thought I'd pass it along.

To put it into context, an operator will get a Notification at 4:00 am asking them if a certain (sometimes long running) batch is still running.  If they click No the workflow ends and sends out an e-mail.  

But if they click yes, the next time I want to ask is 5:00 am.  Then once more at 5:50 am if it is still going. (We need to physically go alert people if it's going to run into 6:00 so they stay out of the system as that's when they normally log in.)

I was stumped at a workflow because I have to assume they won't be clicking 'Yes' right away when the pop up comes up.  Setting a static timer for after they click yes just won't work as these need to be hard set times.  

In a JOBS after the notification I have the following.  I'm sure there is a better way to do it, but wanted to share as you never know if someone is looking for something just like this.


:SET &TIME# = SYS_TIME("HH:MM:SS")

:SET &DIFF# = SUB_TIME("HH:MM:SS;05:00:00","HH:MM:SS;&TIME#",SS)
!:PRINT &DIFF#
:SET &DIFFCLEAN# = FORMAT(&DIFF#)
!:PRINT &DIFFCLEAN#

:WAIT &DIFFCLEAN#



Short notes version:
- Gets the current time
- Gets the difference between the current time and a set time of 5:00 am and outputs it in seconds (the wait timer works in seconds)
- Removes the leading zeros before the number of seconds.
- Sets timer to exact number of seconds until 5:00 am

Outcomes