Automic Workload Automation

  • 1.  Call Api get last RunID

    Posted Oct 25, 2018 09:52 AM

    Hi,

     

    I want to use a VB script to ask the last run ID from a specific jobplan (with callapi).

    But I don't receive any output if I use this:

    :SET &RUN_ID# = GET_UC_OBJECT_NR(jobname)

     

    Is there a procedure to get the last RunID from a jobplan by callapi?

    thx!!

    br

    Sören



  • 2.  Re: Call Api get last RunID

    Posted Oct 25, 2018 01:13 PM

    Give this a try.  I tested it on my V11.2.1 SQLServer system.  You should be able to run it from a VARA.SQLI object;

     

    select ah_idnr as MostRecentRUNID, ah_name
    from (
    select * from ah
    where ah_oh_idnr = (select oh_idnr from oh where oh_name = 'my.object.name')) as x
    where ah_TimeStamp1 = (select max(ah_TimeStamp1)
    from ah
    where ah_oh_idnr = (select oh_idnr from oh where oh_name = 'my.object.name'))



  • 3.  Re: Call Api get last RunID

    Posted Oct 29, 2018 05:41 AM

    Hi

     

    I suppose an understanding issue:

     

    GET_UC_OBJECT_NR = Returns the status of an activated object.

    Means that the object must be in a running state (= exist in activities window)

     

    I would recommend using

    :SET &LAST_RUNID# = GET_STATISTIC_DETAIL(,RUNID,"&MYJOBNAME#")

    for your request.

     

    cheers, Wolfgang

     

    PS: hope you are aware that the CALL API "just" executes a script - if you want a runid to be returned in your VB script you must take cate to get it.