AutoSys Workload Automation

 View Only
  • 1.  Retry on fail & mark complete on second fail - not working

    Posted May 07, 2019 03:48 PM

    I have a job which executes a PowerShell. Upon failure it is set to resubmit 1 time after 1 minute wait. That works fine. If I set the job to execute a JS to set job as complete upon fail, that works fine (code I am using below). The problem happens when I use them both. It sets the job as "Auto-Resubmit Failed Job = Yes" then marks it complete, so the second execution does not happen. How can I trap that the job will be auto-resubmitted and not do the force completion until all retries have been executed still leaving a failure?

     

    execCommand('%(WOB._fullname)','%(APPL._name).%APPL._gen', 'ACTION COMPLETE');



  • 2.  Re: Retry on fail & mark complete on second fail - not working
    Best Answer

    Posted May 07, 2019 04:11 PM

    This seems to have handled the issue. Putting here for others if needed.

     

    if (WOB._cmpc != null && WOB._subcount > WOB._retrycount)

    {

    execCommand('%(WOB._fullname)','%(APPL._name).%APPL._gen', 'ACTION COMPLETE');

    }