We created an Include that is used to test successor tasks to the name set in the &empty_task variable to determine if they are to execute or not. This is needed since there is no discernible method (that we have ever figured out) of using the Dependencies Properties that allows, for example, task_1 to not execute due to a STOP NOMSG (Status 1910/ENDED_EMPTY) and then not execute multiple tasks not directly linked to that task. These predecessor tasks are often File Transfers that may not execute due to a missing or empty file and we do not wish some number of successor task(s) to execute.
The normal approach for us is to make a sub-process flow to follow task_1 that contains the multiple successor tasks. That way there will be but a single task, the sub-process flow, that needs to check task_1’s status. This Include allows the checking to occur in the Pre Process or Process tab of the successor task(s), and if task_1 ended with a STOP NOMSG so will the successor task using this Include. The status of task_1’s completion is acquired from a GET_STATISTIC_DETAIL Script function that is not qualified by a run ID.
The Dependency Status of the successor task(s) will most likely be ANY_OK. Obviously a decision must be made between the appropriateness of using this facility or the normal sub-process technique.Hope this helps.
! COMMON_ENDED_EMPTY_TASK_CHECK Include
!
! Sample use -
!
! :SET &empty_task = "some_predecessor_task_name"
! :INC COMMON_ENDED_EMPTY_TASK_CHECK
! ! other logic as needed
!
:IF SYS_ACT_PARENT_NAME() NE " "
! Executing in a process flow
: SET &status = GET_STATISTIC_DETAIL(,STATUS,&empty_task)
: SET &end_time = GET_STATISTIC_DETAIL(,END_TIME,&empty_task)
: IF &status EQ 1910
! ENDED_EMPTY / STOP NOMSG !
: SET &status = FORMAT(&status)
: SET &emsg = "&empty_task ended at &end_time with Status &status."
: PRINT "&emsg"
: PRINT " This task will not execute."
: STOP NOMSG,55,"&emsg"
: ELSE
: PRINT "Execution continues,"
: PRINT " &empty_task completed at &end_time with a Status of &status."
: ENDIF
:ELSE
: PRINT "Not executing as a task, execution continues."
: ENDIF