Automic Workload Automation

 View Only
  • 1.  Change job status to ENDED_EMPTY if no results are found

    Posted Nov 23, 2022 09:47 AM
    I'm working on a job that checks for tasks in a remote AE system. I'd like to make the task end with the status ENDED_EMPTY if no matching tasks are found. I don't want the task to end with an error status, because I'd like to distinguish the case where no results are found, which is normal, from an error condition.

    I know it's possible to mark a task ENDED_NOT_OK using :MODIFY_TASK, but so far I haven't figured out how to mark a task ENDED_EMPTY. Does anyone know a way to accomplish this? Alternatively, is there a way to change the task to some other non-error status?

    There was an earlier discussion about this, but the names of the participants were lost during one forum migration or another.


  • 2.  RE: Change job status to ENDED_EMPTY if no results are found

    Posted Nov 24, 2022 12:58 AM
    Hi @Michael A. Lowry

    I'm pretty sure that :MODIFY_TASK won't work here. Instead you'll want to use :STOP nomsg in the (Pre-)Process tab of a Job or a SCRI.

    I would activate the check Job via ACTIVATE_UC_OBJECT(MY_CHECK_JOB)  (or PREP_PROCESS) and scan the report for the string you expect to occur. If the string doesn't occour, => :STOP NOMSG in the process tab of the calling object. So the calling object gets the status ENDED_OK or ENDED_EMPTY. The job started via A_U_O or P_P (see above) will always get the status ENDED_OK.

    Cheers
    Christoph

    ​ ​

    ------------------------------
    ----------------------------------------------------------------
    Automic AE Consultant and Trainer since 2000
    ----------------------------------------------------------------
    ------------------------------



  • 3.  RE: Change job status to ENDED_EMPTY if no results are found

    Posted Nov 24, 2022 03:00 AM
    Edited by Michael A. Lowry Nov 24, 2022 03:02 AM
    Hi @Christoph Rekers.

    That's what I expected. My understanding is that the AE scripting language provides no way to change the status of a task that has already run, except to ENDED_NOT_OK.

    There is a way to do this via the AWI, in the Process Monitoring perspective: Modify task manually.

    I suppose one could use ModifyTaskState, but then this again requires a second job.