Automic Workload Automation

Expand all | Collapse all

Cancel and deactivate everything under attached to a queue

Jump to Best Answer
  • 1.  Cancel and deactivate everything under attached to a queue

    Posted 06-07-2018 03:49 AM

    Hello,

     

    As part of a client maintenance process we need to delete some objects (including queues).

     

    I have written the code to delete the objects through the API but some of those objects are queues.  Before I delete these i think it need to cancel and deactivate everything attached to it?

     

    Is there an easy way to do this rather than having to find all those objects and cancelling them one by one?  If this has been deemed ok to delete then I do not care what is running (if anything).against the queue.

     

    If I have to do the latter, again is there any easy way to get all the top level run ids (activators/parents) that I can feed into CANCEL_UC_OBJECT()?

     

    Cheers,

     

    Dan



  • 2.  Re: Cancel and deactivate everything under attached to a queue
    Best Answer

    Posted 06-07-2018 04:40 AM

    Hi

     

    I would create a SQLI VARA searching for all objects contained in the queue

     

    select eh_name, eh_ah_idnr, eh_status, eh_starttime from EH
    where eh_client = 1
    and eh_queue = 'MYGREATQUEUE';

     

    and use the scriptcommands below to cancel all running objects, deactivate them and stop the queue and remove it (if necessary)

     

    SYS_ACT_TOP_NR
    SYS_ACT_TOP_NAME
    CANCEL_UC_OBJECT
    DEACTIVATE_UC_OBJECT
    MODIFY_SYSTEM[QUEUE]
    REMOVE_OBJECT

     

    cheers, Wolfgang



  • 3.  Re: Cancel and deactivate everything under attached to a queue

    Posted 06-07-2018 04:55 AM

    Cheers Wolfgang, will give it a whirl.

     

    Dan