AutoSys Workload Automation

  • 1.  Auto Force Complete Apps Based on Age

    Posted Aug 13, 2018 07:22 PM

    I'm wondering if there is a way to schedule something to run on a schedule to force complete applications that are older than X days old. We are wanting to have something to run periodically to maintain our test system, we often have issues where users do not cleanup their failed apps



  • 2.  Re: Auto Force Complete Apps Based on Age

    Posted Aug 14, 2018 08:03 AM

    Mister Anderson. .

     

    I am going to answer based on the assumption that you are using ESP, also because we use ESP here.  Perhaps, you can use these concepts in whatever scheduler you are using.

     

    The simplest way to do this is to use a self completing task to clean up the application by force completing everything.  This task uses an AJ command, and can be scheduled however you like.  I use these, sometimes, to automatically clean up a generation of an application right before the event is due.  So for example, the cleanup task cleans up the application at 11:59, and the event triggers at midnight.  Here is an example:

     

    JOB CLEANUP TASK SELFCOMPLETING              
     RUN DAILY                                   
     DELAYSUB 17:30                              
     ESP AJ ALL COMPLETE APPL(%ESPAPPL..%ESPAPGEN)
    ENDJOB                                       

     

    You could add some CLANG to the run statement of this type of task, like this:

     

    IF ESPAHH > '7' and ESPAHH < '19' Then Delaysub 19:00

     

    Hope this helps!

    <JC>



  • 3.  Re: Auto Force Complete Apps Based on Age

    Posted Aug 14, 2018 08:09 AM

    Hi Jonathan. We are using DE although most people in my company refer to it as ESP, I think because may be it was called ESP at one point long time ago?? It was well before my time.

     

    I'm sorry if it wasn't clear that I was using DE, I thought I tagged the question within DE, maybe I just imagined that. Thank you for your input.

     

    Anyone else out there using something like this specifically for DE I'd love to hear how it is working for you.



  • 4.  Re: Auto Force Complete Apps Based on Age

    Posted Aug 14, 2018 08:18 AM

    Mister Anderson,

     

    You did, I just overlooked the tagging.  Now that I see where it is, I will be more careful  

     

    <JC>



  • 5.  Re: Auto Force Complete Apps Based on Age

    Broadcom Employee
    Posted Aug 14, 2018 12:50 PM

    I would assume you don't want to schedule something to force complete all active applications, and you can monitor for failed or not completed jobs using the custom views.

    You can follow the same approach described by JC in DE using Alert javascript with execCommand function. Monitor for Overdue (not completed by) in a job and setup a generic Alert javascript that you can use in any job to force complete the application like below;

    execCommand('ALL','%(APPL._name).%APPL._gen','ACTION COMPLETE');

    or
    execCommand('ALL','%(APPL._name).%APPL._gen','ACTION COMPLETE Reason ("force complete application")');



  • 6.  Re: Auto Force Complete Apps Based on Age

    Posted Aug 14, 2018 01:01 PM

    What we are trying to do is schedule something that can run maybe every day and that would force complete ALL applications (no matter what state they are in) that are 2 days old (2 days old from it's start time). The amount of days is not necessarily important, more so wondering if something like this can be done.

     

    This would only be used in our TEST environment as we have a lot of issues with users not addressing their apps.



  • 7.  Re: Auto Force Complete Apps Based on Age

    Posted Aug 16, 2018 09:22 AM

    We have the same issue in our test environment and we manually complete old applications or jobs.  Would be great if we could come up with a way to do this.  We would also just do this in the TEST env,  not in PROD.

     

    Sharon



  • 8.  Re: Auto Force Complete Apps Based on Age

    Broadcom Employee
    Posted Aug 16, 2018 12:50 PM

    Maybe the approach below could work, but it will require to be tested/adjusted.

     

    The APPL._RDATE built-in symbolic variable stores the date when the application started to run:


    https://docops.ca.com/ca-workload-automation-de/12-0/en/scheduling/javascripts/symbolic-variables/built-in-symbolic-variables#Built-inSymbolicVariables-DateandTimeBuilt-inSymbolicVariables

     

    The "daysFrom" calendar javascript function calculates the number of days from a date you specify to today:

     

    https://docops.ca.com/ca-workload-automation-de/12-0/en/scheduling/javascripts/built-in-functions/calendar-javascript-functions#CalendarJavascriptFunctions-daysFrom

     

    So, the idea here is to use the "daysFrom" function to calculate the number of the days contained in "APPL._RDATE" variable, like:

     

    APPL.daynumber = daysFrom('%APPL._RDATE');

     

    If "APPL.daynumber"= 2, then the javascript mentioned above by Segun should be executed:

     

    execCommand('ALL','%(APPL._name).%APPL._gen','ACTION COMPLETE Reason ("force complete application")');

     

    Again, this should be tested. It's like a "brainstorm" idea. Not 100% sure if it is feasible.


    Otherwise, I would suggest you to create an idea to add this capability in DSERIES.