Here's a check against objects in "waiting" state which should cancel them if they exceed the threshold (in this instance 10 minutes). If this is scheduled to run consistently in the background it should allow for a grace period in execution and then cancel them afterward. I haven't written in the notification to the team, but that would come next.
This uses a VSQLI call for the following:
select EH_NAME,EH_AH_IDNR,EH_ACTIVATIONTIME from EH where EH_CLIENT=&$CLIENT# and EH_STATUS=1709 order by EH_NAME
:SET &PARALLELS# = PREP_PROCESS_VAR(TOOLS.VSQLI.PARALLELRUNS)
:SET &CURRENTDATE# = SYS_DATE("YYYY-MM-DD")
:SET &CURRENTTIME# = SYS_TIME("HH:MM:SS")
!Read through all parallel runs and get their activation times
:PROCESS &PARALLELS#
: SET &OBJNAME# = GET_PROCESS_LINE(&PARALLELS#,2)
: SET &OBJRUNID# = GET_PROCESS_LINE(&PARALLELS#,3)
: SET &OBJTIME# = GET_PROCESS_LINE(&PARALLELS#,4)
!Compare activation date against current date
: DEFINE &ACTSPLIT#,STRING,2
: FILL &ACTSPLIT#[] = STR_SPLIT(&OBJTIME#," ")
: SET &DATEDIFF# = DIFF_DATE("YYYY-MM-DD:&ACTSPLIT#[1]","YYYY-MM-DD:&CURRENTDATE#")
: SET &DATEDIFF# = FORMAT(&DATEDIFF#,"000")
!Compare activation time against current time
: DEFINE &TIMESPLIT#,STRING,2
: FILL &TIMESPLIT#[] = STR_SPLIT(&ACTSPLIT#[2],".")
: SET &TIMEDIFF# = DIFF_TIME("HH:MM:SS;&TIMESPLIT#[1]","HH:MM:SS;&CURRENTTIME#")
!: PRINT "ACTIVATION TIME: &ACTSPLIT#[1] &ACTSPLIT#[2] ||| CURRENT TIME: &CURRENTDATE# &CURRENTTIME# ||| DIFFERENCE: &DATEDIFF# &TIMEDIFF#"
!If the wait time exceeds 10 minutes, cancel the waiting Object execution
: IF &TIMEDIFF# > "001000"
: SET &DAYHH# = MULT(&DATEDIFF#,24)
: SET &HH# = STR_CUT(&TIMEDIFF#,1,2)
: SET &HH# = ADD(&HH#,&DAYHH#)
: SET &HH# = FORMAT(&HH#,"00")
: SET &MM# = STR_CUT(&TIMEDIFF#,3,2)
: SET &SS# = STR_CUT(&TIMEDIFF#,5,2)
: PRINT "&OBJNAME# (RUNID &OBJRUNID#) HAS EXCEEDED ITS RUN GRACE PERIOD BY &HH#:&MM#:&SS#"
: SET &CANCEL# = CANCEL_UC_OBJECT(&OBJRUNID#,"ENDED_TIMEOUT")
: ENDIF
:ENDPROCESS
:CLOSE_PROCESS &PARALLELS#
This method has excess information and is rather verbose, but at this point that would be to allow differing grace period options per team if we wanted to sort by team rather than a one-size-fits-all approach.
Thoughts?