Finding the status of a workflow or task by its alias name
search cancel

Finding the status of a workflow or task by its alias name

book

Article ID: 231844

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

Is there a way to find the active status (SYS_STATE_ACTIVE) of a workflow or task with an alias name?  For example:
There is a workflow that kicks off multiple times every 15 minutes.  It uses an alias to determine what its function will be.  The next workflow of a specific alias should only run if the previous run has finished.  Is there a way to find if the previous run is still running based on its alias name?

Resolution

The best way to do this may be to use Pre-Conditions on the first task in the workflow.  The pre-condition to use would be the "Check Activities" condition which allows the use of an task alias or name.  For example, if there is a workflow with JOBS.SLEEP.200 in it (which sleeps for 200 seconds), and the workflow has that as the first task with an alias of 200_1.  If there is a pre-condition on the first task of:

IF 200_1 resides >= 1 times with status ANY_RUNNING in activity window
  FINALLY cancel Workflow *OWN including sub-ordinate tasks
ELSE
  RINALLY run task

More information on Preconditions can be found here: https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/12.3/Automic%20Automation%20Guides/help.htm#AWA/Workflows/wf_PropertiesPane_CondTab.htm

The only caveat to note is that the status needs to be checked as "ANY_RUNNING" in the example above does not include generating, so if there is script (wait for example or other long generating script) that is generating the next time around, it will not see it as "running".