AnsweredAssumed Answered

Fix a script. Details below.

Question asked by Reddy on Apr 26, 2018

Hello,

 

I'm trying to write a script with a notification object to send an email if a workflow failes to end normally. I added a statement to collect parent run id and its status based on which a notification has to be sent. Please see below. But it doesn't work.

In the report of this script, i get empty fields for job.name ruinid and its parent runid. How can this be fixed? Thanks in advance.

 

Script:

:SET &RUN_IDA# = GET_UC_OBJECT_NR("JOB.NAME")
:PRINT &RUN_IDA#
:SET &RUN_IDB# = GET_PARENT_NR(&RUN_IDA#,ACT)
:PRINT &RUN_IDB#
:SET &STATUS# = GET_UC_OBJECT_STATUS(,&RUN_IDB#,STATUS)
:PRINT &STATUS#
:IF &STATUS# <> 1900
:SET &NOTIFICATION# = ACTIVATE_UC_OBJECT(NOTIFICATION1)
:PRINT "ERROR NOTIFICATION IS SENT"
:ELSE
:SET &NOTIFICATION# = ACTIVATE_UC_OBJECT(NOTIFICATION2)
:PRINT "SUCCESSFUL NOTIFICATION IS SENT"
:ENDIF

Outcomes