Automic Workload Automation

 View Only
  • 1.  Script function to suspend jobs/workflows running through JSCH

    Posted Jul 12, 2020 07:38 AM
    Hi Team,
    Is there a script function available to suspend jobs/work flows running through a JSCH? We have weekly maintenance activities in which we have to manually edit the schedules to deactivate a bunch of jobs and we want to avoid this manual effort. 
    The other option is to create a seperate JSCH for those jobs/workflows and suspend recursively when required. But just wanted to know if there is any other way.

    Thanks,
    Kumar


  • 2.  RE: Script function to suspend jobs/workflows running through JSCH
    Best Answer

    Posted Jul 13, 2020 02:56 AM
    Hi Kumar,

    unfortunately there is no AE script statement available to deactivate an object within a JSCH. There might be a Java class available but it will not help in your situation. Options you have are as follows:

    1) create a seperate JSCH object
    2) keep objects in the existing JSCH but create a checking logic at start time (i.e. from the PreProcess tab check the status of a SYNC object or content of a VARA and then decide to run or end the task)
    3) create and assign a specific QUEUE object. In case of maintenance stop the queue so objects wont start. But they will be stored in the queue and started as soon as you start the queue again.

    kr,
    Peter


  • 3.  RE: Script function to suspend jobs/workflows running through JSCH

    Posted Jul 13, 2020 11:01 AM
    Couple of ideas for you.  Other options might be to use a separate QUEUE or even a SYNC object.   

    Queue's can be toggled to stop-mode.    The downfall is that objects within the schedule would stack up if your outage window spanned multiple days, for instance.   However, an advantage is that when the QUEUE is started after the maintenance is complete, there's nothing to catch up on....everything starts when the queue starts.      

    SYNC objects can be set to skip execution of an object in the sync object assignment on the general tab.  You could create a sync object with a NORMAL and MAINTENANCE mode and assign that to the objects in question.   I believe the SET_SYNC script function will toggle the sync to a mode of your choosing.


  • 4.  RE: Script function to suspend jobs/workflows running through JSCH

    Posted Jul 13, 2020 11:54 AM
    Edited by Pete Wirfs Jul 13, 2020 12:49 PM
    The solution we applied here is to set up a STATIC VAR that tells the select processes to run or not.  Then we include this script inside of those workflows;

    :set &GwBatchesState# = get_var(gw.batches.state,state,1)
    :print "Guidewire Batches State: &GwBatchesState#"
    
    :if &GwBatchesState# = "OFF"
    :  print "The GW.BATCHES.STATE is OFF.  Terminating."
    :  stop NOMSG
    :endif​

    We then created these two workflows to alter its state;
       GW.BATCHES.STATE.ON
       GW.BATCHES.STATE.OFF

    A cool thing about this solution is we can also schedule the execution of the ON/OFF workflows for planned or regular outages.  Our ON/OFF processes also send an alert to the appropriate people.

    ------------------------------
    Pete Wirfs
    SAIF Corporation
    Salem Oregon USA
    ------------------------------



  • 5.  RE: Script function to suspend jobs/workflows running through JSCH

    Posted Feb 22, 2022 04:34 AM
    Hi Pete,

    Lets say I have 10 completely unrelated workflows to suspend. Is it possible to create a solution where I can put the name of the workflows in a static vara object and run a command to turn off the execution of all these workflows? Of course these workflows will have the script in them.


  • 6.  RE: Script function to suspend jobs/workflows running through JSCH

    Posted Feb 22, 2022 12:56 PM

    @KumarRahul605332

    The solution I posted does not need a static vara.  However it does require you add the prescribed script into all of the desired workflows.



    ------------------------------
    Pete Wirfs
    SAIF Corporation
    Salem Oregon USA
    ------------------------------



  • 7.  RE: Script function to suspend jobs/workflows running through JSCH

    Posted Jul 15, 2020 05:52 AM
    Hi Kumar,
    our maintanance time with server shutdown is monthly from 02:00 till 05:00 AM.
    We use the following construct: We generally start all workflows which will be affected through the schedule at 00:01 AM with a starttime in the workflow, for example 02:30 AM. So when the AE starts again all workflows will start immediately, on other days they start at 02:30 AM.
    Greetings
    Bernhard

    ------------------------------
    Landeshauptstadt München
    ------------------------------