Wow... That sounds a lot cleaner than what we do! We should replace some of our complicated code by just checking that variable?
We have a combination of a "pre-processing" include and a "post-processing" include to check/update a "Published value" in the system.
Pre-processing include::DEFINE &PRP_ITER#, UNSIGNED:DEFINE &PRP_UPD_ITER#, STRING:IF SYS_ACT_RESTART() = "Y"
: IF ISNUMERIC(&PRP_ITER#) = "N"
: PSET &PRP_ITER# = 0
: ENDIF
: PRINT "------------------------------------------------"
: PRINT "FROM PREP: THIS TASK WAS STARTED IN RESTART MODE"
: PRINT "------------------------------------------------"
: PRINT "FROM PREP: ACTIVATOR RUNID - &$ACTIVATOR_RUNID#"
: PRINT "FROM PREP: RESTART RUNID - &$RESTART_RUNID#"
: PRINT "FROM PREP: RUNID - &$RUNID#"
: PSET &PRP_UPD_ITER# = GET_PUBLISHED_VALUE(&$ACTIVATOR_RUNID#,PRP_ITER#): PSET &PRP_UPD_ITER_TRIM# = STR_TRIM(&PRP_UPD_ITER#)
etc...
Post-processing include::IF &RETCODE# <> 0: PSET &PRP_ITER# = FORMAT(&PRP_ITER#)
: IF &PS_RESTART_ATTEMPTS# > 0
: IF &PRP_ITER# < &PS_RESTART_ATTEMPTS#: PRINT "----------------------------------------------------------------------"
: PRINT "FROM POST: THIS IS RESTART ATTEMPT &PRP_ITER# OF &PS_RESTART_ATTEMPTS#"
: PRINT "FROM POST: WAITING &PS_RESTART_WAIT# SECONDS UNTIL NEXT ATTEMPT"
: PRINT "----------------------------------------------------------------------"
: PSET &PRP_ITER# = ADD(&PRP_ITER#,1): WAIT &PS_RESTART_WAIT#: PSET &POP_RESTRUNID# = RESTART_UC_OBJECT(&$NAME#,&$RUNID#,,,&$QUEUE#)etc...
Original Message:
Sent: 07-12-2019 02:51 PM
From: Pete Wirfs
Subject: Variables & Restarts
Check out system variable: &$RESTART_COUNT#
------------------------------
Pete (AE V11.2)
Original Message:
Sent: 07-12-2019 02:35 PM
From: Albrecht
Subject: Variables & Restarts
Hi. I have a customized solution that I got from consulting to trigger QlikSense Tasks from Automic. Basically the process triggers the task and then there's a 2nd job that queries QlikSense for the status of that task and keeps checking until the task has a FinishedSuccess status on the QlikSense side. The 2nd job has a post condition that checks the status and if it isn't FinishedSuccess, it will "restart" the 2nd job in 1 minute.
It works fine, but I'm trying to add some enhancements to the process.
I need to keep track of the number of restarts. For example, if there's a problem on the QlikSense side and the process is stuck - we don't want it to keep restarting the get status job indefinetely. So we're setting a "max # of restarts" value. But I need to be able to compare that number to the actual number of restarts.
I tried using PSET and RSET, but it isn't doing exactly what I want. It sets the value for the 1st and 2nd runs, but then after that it doesn't increase, it remains at 2.
I just have this in the Post Process of this 2nd job.
: PSET &RESTART_NO# = ADD(&RESTART_NO#, 1)
: PRINT 'This is Restart Number &RESTART_NO#'
I really don't want to have to create a temporary variable to store this info. It seems like there should be a way to do this, but I'm missing something.
Any ideas?
Thanks.
------------------------------
Enterprise Scheduling Lead
Takeda
------------------------------