Automic Workload Automation

 View Only
  • 1.  Modify State to blocked

    Posted Nov 11, 2019 10:08 AM
    Hello everybody,

    I'm using a script part like this:
    :SET &HND# = PREP_PROCESS_REPORT(,,,"*cannot find the file*")
    :
    PROCESS &HND#
    :  
    MODIFY_STATE STATUS_TEXT="Files not found"
    :  
    MODIFY_STATE RETCODE=50
    :
    ENDPROCESS



    But I need another State "RETCODE=50" is for "ENDED_NOT_OK_canceled".

    What I need is the RETCODE for "blocked".

    Did anybody know the correct code?

    Thank you


  • 2.  RE: Modify State to blocked

    Posted Nov 11, 2019 10:33 AM
    ​Hi.

    I think you are mixing concepts here. For the sake of discussion, it would be good if you would post your actual code, not the verbatim example from the manual. But regardless:

    There's operating system return codes ($? on UNIX, %errorlevel% on Windows), and there's Automic status codes. OS return codes are usually 0 to 127, and Automic status codes are always four digits, 0001-0999 (user defined) or 1000 and above (built-in). OS return codes greater than zero, by default, result in a failure state in Automic.

    That example from the manual you posted uses :MODIFY_STATE to fake an OS return code > 0, thus ensuring that the action happens that has been defined for this. The manual page for :MODIFY_STATE is poorly written, contains at least one major mistake, and 50 is an arbitary choice. You only need to use :MODIFY_STATE if you call code from Automic, and that code faults, but still returns OS return code zero. This is a rare occurence.

    The Automic status code for "BLOCKED" is 1898.

    Here's all the codes:
    https://docs.automic.com/documentation/webhelp/english/ALL/components/AE/11/All%20Guides/Content/ucaaiy.htm

    But you can not simply substitute "50" for "1898". Instead, if you really need to use :MODIFY_STATE, you additionally need to tell Automic in your job plan editor to block your job (or job plan) if the OS return code exceeds some limit - in which case you might as well continue to use a value of 50 or any other arbitary, higher-than-zero value.

    Hth,


  • 3.  RE: Modify State to blocked
    Best Answer

    Posted Nov 12, 2019 03:01 AM
    Hi,
    please check this link

    https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/12.2/AWA%20Guides/help.htm#AWA/Executions/ReturnCodesExec.htm?Highlight=return%20code

    1898 Blocked

    1899 Status blocked manually removed

    Hope this helps.

    ------------------------------
    Regards,
    Carlos
    ------------------------------