Automic Workload Automation

  • 1.  Deregister/deactivate jobplans running in context of a job group

    Posted Aug 31, 2018 09:42 AM

    Hello,

    I have a simple jobplan with a script that activates jobplans. These jobplans are activated in the context of a jobgroup. The job group is activated right after the script and will allow the (one by one) execution of the jobplans registered by the script.

    Now if I cancel the main  jobplan with "cancel recursive" then the job group will be cancelled (and in my case also deactivated) and the active "child" jobplan which was running in the context of the job group is also cancelled and deactivated.

    All the jobplans which were registered but not yet started stay in the activity window. Is there anyway I can deregister/deactivate these "child" jobplans when the job group is cancelled and deactivated? This to prevent that these "child" jobplans will be activated next time the job group is active. So every time I start the main jobplan I want to start with a 'clean sheet'.

     

    Many thanks for your suggestions, Herman.



  • 2.  Re: Deregister/deactivate jobplans running in context of a job group

    Posted Sep 25, 2018 05:13 AM

    Hi

     

    as first attempt you could check at workflow start which objects are in state "registered" and identify the JOBG that started them. - e.g. per SQLI VARA

     

    select EH_NAME,eh_ah_idnr, EH_STARTTYPE, eh_status from EH
    where eh_client = 1
    and eh_status = 1710

     

    then you could cancel&deactivate all objects that fit the query.

     

    one disadvantage of this attempt is that you have to know and provide the JOBG's name as parameter to identify the "leftovers" in activity window.

     

    cheers, Wolfgang



  • 3.  Re: Deregister/deactivate jobplans running in context of a job group

    Posted Sep 26, 2018 04:31 AM

    Hello Wolfgang,

    your idea is indeed a possible solution. I know the job group's name so I can do this.

     

    For this jobplan I've found an easy solution. The jobgroup has a parallelism of '1'. So only 1 'child' jobplan can run at the same moment in time. Therefor I constructed a "FOREACH" jobplan which launches the 'child' jobplans one by one. The advantage of a "FOREACH" jobplan is that the 'child' jobplans are only activated on the moment that the "FOREACH" parent jobplan reads the next entry in the vara object which it is using to launch the 'child' jobplans. So if the 'parent' jobplan is stopped and deactivated the running 'child' jobplan is also stopped and deactivated and no other 'child' jobplan is left in the acticity window because they were not activated/registered yet.

     

    In the case where several 'child' jobplans would have to run in parallel my solution wouldn't work. Then I'll test out your solution. Many thanks, Herman.