Automic Workload Automation

Expand all | Collapse all

How to obtain returncode of objects activated by CallAPI?

  • 1.  How to obtain returncode of objects activated by CallAPI?

    Posted 12-07-2018 03:49 AM

    Out Testers are activating objects inside the Automation engine from within a shellscript by calling the CallAPI.

    How can they obtain the returncode of the activated object from inside the Automation engine within their shellscript to see if the object worked nicely?

    At the moment all they get is the returncode of the CallAPI script, which is mainly "0" because the CallAPI itself is always activated without any error.



  • 2.  Re: How to obtain returncode of objects activated by CallAPI?

    Posted 12-13-2018 09:01 AM

    Perhaps while you are designing the call, you can use the solution application within PAM to get a better return code.  Here is some documentation on that:

     

    Create a Solution Using an API Activity - CA Process Automation - 04.3.03 - CA Technologies Documentation 



  • 3.  Re: How to obtain returncode of objects activated by CallAPI?

    Posted 01-01-2019 02:45 PM

    Hi

     

    Hmm thats a bit tricky as the CALL API is not designed for returning infos except the RUn ID to the OS...

     

    the possibilities that come to my mind are:

     

    * start the CALL API via Automic OS job and check the children's status in PostProcess with script commands.
    * start the CALL API via OS command and create a "Report file" containing the Status info with an OS job afterwards on a defined drive or share

    * you could send an email with the values afterwards...
    * possibly there is an additional way using JAVA API ...

     

    cheers, Wolfgang



  • 4.  Re: How to obtain returncode of objects activated by CallAPI?

    Posted 01-02-2019 03:16 AM

    Hi again

     

    I observed a script trick from a colleague lately to get the child Status from the call API....

     

    if you put a stop msg at the end of the script that is used by the call api its output gets inserted into the call api output:

     

    :set &OBJ# = 'SCRI.UC4.CALLAPITEST'
    :set &jobnr# = activate_uc_object(&OBJ#,WAIT)
    :if &jobnr# = '0000000'
    :   stop msg,51,'Failure at starting job &OBJ#'
    :else
    :   set &STAT# = GET_UC_OBJECT_STATUS (,&jobnr#)
    :   PRINT 'Job $OBJECT with jobnumber &jobnr# started'
    :   PRINT 'Status: &STAT#'
    :   stop msg,50,'Job &OBJ#  with jobnumber &jobnr# and Status &STAT#  started.'
    :endif

     

    Output from the CALL API on OS level:

    20190102/090857.023 - U03000000 Program 'UC4 Call Interface' version '11.2.2+build.622' started.

    20190102/090857.023 - U03000017 2016-06-20|21:27:52|
    20190102/090857.458 - U03000004 RunID '327720598'

    20190102/090857.459 - U00000050 Job SCRI.UC4.CALLAPITEST  with jobnumber 0327720599 and Status 1900  started.

    20190102/090857.459 - U03000001 Program 'UC4 Call Interface' version '11.2.2+build.622' ended normally.

     

    Disadvantage: the API* Object fails with FAULT_OTHER-1820 because of the STOP MSG.....

     

    cheers, Wolfgang