Automic Workload Automation

 View Only
Expand all | Collapse all

Stop Schedules/Events through Automic Scripting

  • 1.  Stop Schedules/Events through Automic Scripting

    Posted Jan 06, 2020 06:22 AM
    Hello Team,

    I'm wondering if there is any way where we can stop/start the Schedules/Events through scripts. I know that we can use ACTIVATE_UC_OBJECT to start the objects. Is there any method where we can stop the Schedules&Events at certain point of time and release them back. I've gone through documentation but I didn't find any methods to stop Schedules/Events (MODIFY_TASK is there but it's only for JOBP similarly MODIFY_SYSTEM can be used for QUEUE but not JSCH and JOBP). 

    We are going live with one of the project where we might have to stop the Events frequently for downtime. It would be  great if we can achieve this through Automic Scripting so that we can add it in a schedule without any manual intervention.

    ------------------------------
    Bharath B.
    ------------------------------


  • 2.  RE: Stop Schedules/Events through Automic Scripting



  • 3.  RE: Stop Schedules/Events through Automic Scripting

    Posted Jan 06, 2020 06:54 AM
    Hi @Carsten Schmitz, CANCEL_UC_OBJECT will cancel the event and I need to use ACTIVATE_UC_OBJECT again to start it back. I am looking to pause the schedule/event similar to the way how we can Suspend them ​in the Process Monitoring

    ------------------------------
    Bharath B.
    ------------------------------



  • 4.  RE: Stop Schedules/Events through Automic Scripting

    Posted Jan 06, 2020 07:13 AM
    Hi @B Bharath Kumar Reddy,

    sorry, I missread.​ No, I don't know of a way to suspend events or schedules by script and after scouring the list of script functions, I don't think there is.

    You could possibly put the events and schedules in question into a queue, and suspend that by sending "stop" and "go" commands to the queue with MODIFY_SYSTEM(). I'm not sure though whether that really works in real-time in all cases, so I'd advise you to test it beforehand.

    Best regards,
    Carsten



  • 5.  RE: Stop Schedules/Events through Automic Scripting

    Posted Jan 06, 2020 12:16 PM
    The way we "pause" iterative processes, is with a state flag.   Then we either set the state flag on or off  which we do with two separate workflows, which can then be easily scheduled to run at the appropriate time.

    Then we add this logic into the process script of the workflows that we want to automatically pause;

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


    ------------------------------
    Pete
    ------------------------------



  • 6.  RE: Stop Schedules/Events through Automic Scripting

    Posted Jan 07, 2020 07:52 AM
    HI @Pete Wirfs Thank you for this.. I've slightly modified this and created my own version.

    - Create a vara with Maintenance mode as ON/OFF
    - In the event process tab check for this vara value. If the value is OFF then the workflow will run else it will skip.
    - Modify the VARA whenever we want to start the maintenance so that the value will be ON and the workflow will not run.

    However, as Wolfgang suggested, there is direct command TOGGLE_OBJECT_STATUS which will stop and start the events and schedulers.​​

    ------------------------------
    Bharath B.
    ------------------------------



  • 7.  RE: Stop Schedules/Events through Automic Scripting
    Best Answer

    Posted Jan 07, 2020 05:31 AM
    happy new year!

    the magical script command is TOGGLE_OBJECT_STATUS.

    works for
    • Agent Group (HOSTG)
    • Event (EVNT)
    • Job Group (JOBG)
    • Remote Task Manager (JOBQ)
    • Period (PERIOD)
    • Schedule (JSCH)
    • Workflow (JOBP)


    https://docs.automic.com/documentation/webhelp/english/AA/12.3/DOCU/12.3/Automic%20Automation%20Guides/help.htm#Script/Reference/TOGGLE_OBJECT_STATUS.htm%3FTocPath%3DReference%7CAutomation%2520Engine%2520Script%2520Reference%7CScript%2520Elements%2520Ordered%2520by%2520Purpose%7CTasks%7C_____40

    cheers, Wolfgang

    ------------------------------
    Support Info:
    if you are using one of the latest version of UC4 / AWA / One Automation please get in contact with Support to open a ticket.
    Otherwise update/upgrade your system and check if the problem still exists.
    ------------------------------



  • 8.  RE: Stop Schedules/Events through Automic Scripting

    Posted Jan 07, 2020 07:01 AM
    @Frank Muffke Happy New Year!!!

    Thank you so much, this will do the work.​

    The solution mentioned by @Pete Wirfs also works but this is more straight forward.


    ------------------------------
    Bharath B.
    ------------------------------



  • 9.  RE: Stop Schedules/Events through Automic Scripting

    Posted Jan 07, 2020 08:30 AM
    We have an event that we execute to set schedules/events/workflows to either stop or go.  The script function that does it is TOGGLE_OBJECT_STATUS.  The Process tab has some read statements that requests the time that it should be toggled and inserts the time on the event tab.  If the object should be stopped on a different day, we would then execute/once and schedule the event for a future day.  The event process will then check the run number and update if necessary and the appropriate time it will stop/start the object and notify our group that it ran.


  • 10.  RE: Stop Schedules/Events through Automic Scripting

    Posted Jan 13, 2020 10:06 AM
    Just a quick reminder about TOGGLE_OBJECT_STATUS :

    If client is stopped you cannot run any command to start it except manually. The callAPI activated from outside the client needs at least one queue active to run ....

    If you run a stop on a queue you cannot run a start of the queue by script if it is the only active queue in the client ... like CLIENT_QUEUE

    If you stop and restart an event it will resume processing at the time of restart. If it needs to run a specific time (on the clock hour i.e.)  this may be no longer the case.

    Regards.

    Alain