ESP Workload Automation

Expand all | Collapse all

If APPL is executing, do not build a new generation. ESP EE 11.4

  • 1.  If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 13, 2017 03:23 PM

    We currently have logic built into several applications where a new generation will not build if there is currently an active generation;

     

    IF %ESP_APPL_PROC = 0 AND %ESPSADG = 0 THEN +  

    DO                                            

         IF NOT COMPLETED('%ESPAPPL','ALL') THEN EXIT

    ENDDO                                        

     

    This logic is working in all cases, except one. When we use an Event level file trigger and multiple files come in simultaneously. If this happens, multiple generations of the application build.

     

    EVENT ID(PRSCHED.DEMO01) SYSTEM(-) REPLACE                    

    CALENDAR FISCAL                                                

    INVOKE 'A079011.ESP.PROCLIB(DEMO01)'                            

    WOBTRIG FILE_TRIGGER Agent(SCWKLDT1) -                          

           FileName('D:\TEST\eric\TEMP000\test\COUNT*.txt') CREATE -

           State(Monitored) Status('Monitored for CREATE')        

     

    For example, if 3 files that match the trigger criteria come in together, 3 generations will build. We cannot get any more specific with the file names, it has to remain any text file named count***.txt Any thoughts how prevent multiple generations building? No matter how many files come in we only want one generation to build and run. And no other generations to build while the current gen is active. Thank you.



  • 2.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 13, 2017 03:30 PM

    Are the files created by one process or many?

     

    If all the files are created by one process can they create a "done" file?

     

    Then trigger off the "done" file and process all files in directory.

     

    Would that work?



  • 3.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 13, 2017 05:38 PM

    Files are created by different processes. Several customers my be running the process at the same time. There is no logical end or beginning. Just ebbs and flow.



  • 4.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 13, 2017 06:11 PM

    Why not use applewait, like APPL <appl name> POST_OLDEST WAIT 



  • 5.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 18, 2017 10:45 AM

    We don't want the appls to wait, we would like them not to build at all if a current gen is active. We use this logic,

     

    IF %ESP_APPL_PROC = 0 AND %ESPSADG = 0 THEN +  

    DO                                            

         IF NOT COMPLETED('%ESPAPPL','ALL') THEN EXIT

    ENDDO                                        

     

    This logic is working in all cases, except this one. When we use an Event level file trigger and multiple files come in simultaneously. If this happens, multiple generations of the application build. Thank you for the idea and help!



  • 6.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 13, 2017 06:27 PM

    Hi, 

    My concern with this process that you are suggesting is that some files may be missed. The solution below allows the applications to trigger each time BUT....if the previous application processed the data and the file does not exist the application completes. Unfortunately it is not a simple solution. 

    I think it is a better process to build the application job smart enough so it doesn't fail if no file exists. Then trigger it for the update/create every time. 

     

     

    APPL DPFILE61 WAIT

    /* Check to see if the file still exists.
    FILE_TRIGGER FTSERV1
    RUN DAILY
    AGENT AGENTU_01
    FILENAME %ESPWTFIL2 EXIST
    RELEASE (FILEPROC,NOFILE(A))
    ENDJOB

     

    /* If the file doesn't exist then this job completes the application
    JOB NOFILE LINK PROCESS
    RUN ANY
    RELCOUNT 1
    ESPNOMSG AJ ALL APPL(%ESPAPPL..%ESPAPGEN) COMPLETE
    ENDJOB

     

    /* This job processes the file and does whatever it is supposed to do
    UNIX_JOB FILEPROC
    RUN ANY
    RELDELAY 1
    RELCOUNT 1
    AGENT AGENTU_01
    SCRIPTNAME /opt/scripts/testscripts/sleep.sh
    ARGS 5
    ESPNOMSG AJ NOFILE COMPLETE APPL(%ESPAPPL..%ESPAPGEN)
    RELEASE (DELTRGFL)
    ENDJOB

     

    /* This job deletes the file 

    UNIX_JOB DELTRGFL
    RUN ANY
    AGENT AGENTU_01
    SCRIPTNAME /opt/scripts/testscripts/delfile.sh
    ARGS %ESPWTFIL2
    RELEASE (LINK1)
    ENDJOB

     

    /* This job is a delay so the application doesn't close and the next application start before the delete command can process the deletion of the file. 

    JOB LINK1 LINK PROCESS
    RUN ANY
    RELDELAY 1
    ENDJOB

     

     

    Just a thought

    Don.... 



  • 7.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 13, 2017 09:02 PM

    That is what I was leaning towards. I already have a find string job that runs after the customers job. If a file exist it will bring the application back in. This is how we make sure no files are missed. Think I'll need to add a similar job at the beginning of the app. If no filws bypass. I was hoping there was some logic I could add in the event or enhance what we already have in place. 



  • 8.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 14, 2017 07:20 AM

    I tested using an additional find string job at the start of the app. Still experiencing multiple appls running at the same time. What looks like is happening is that they coming so quickly and close together that the JOB_ANCESTOR_WAIT(ANY) does not have time to process. The find sting job runs before the wait kicks in. So, when I create 3 files I have 3 gens sitting out there, first gen running the other two waiting but the find string shows complete.

     



  • 9.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 14, 2017 08:05 AM

    This sounds like a very similar issue to the problem we were having a year or two ago.  The difference, however, was that we were dealing with datasets.  So in this case, Don came to our rescue by giving me an introduction to the %ESPTRDSN variable.  I wonder (and this has been a curiosity to me for awhile) if there is an equivalent way of doing something similar with file watchers on distributed systems.

     

    Another thought I had is could you use a NOTWITH in the job definition of itself (easy first-response)?

     

    A third thought is, could you do something like this:  Use a time variable to give the job a unique name, by adding a qualifier of the time that it was selected.  Then you could add a NOTWITH of any instance of that job running.  We've used these in INSERT tasks, and they look something like this:

     

    JOB <jobname>.INSERT TASK                                      
     RUN TODAY                                                 
     AFTER ADD(CW949X02)                                       
     TIME='%ESPAHH%ESPAMN%ESPASS'                                                             
       ESP APPLINS APPL(%ESPAPPL..%ESPAPGEN) STATEMENTS -      
       ('NT_JOB <job name>.%TIME; -                              
          AGENT WBIBRP01; -                                    
          CMDNAME \\path\to\script; -

           NOTWITH <job name>.-/* */           
         ENDJOB')                                                                                        
    ENDJOB                                                     



  • 10.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4
    Best Answer

    Broadcom Employee
    Posted Apr 17, 2017 05:13 PM

    I suggest that you use a specific EICLASS with MPL(1) for this event, so that all requests will be processed in order. 

     

    Lucy



  • 11.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 18, 2017 02:55 PM

    Setting up an EICLASS solved the problem. Lucy is AWESOEME as always! Thanks to everyone for the help!



  • 12.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 18, 2017 03:29 PM

    What does that mean?  Does anyone have documentation for what an EICLASS is (I wanna learn too!!!)



  • 13.  Re: If APPL is executing, do not build a new generation. ESP EE 11.4

    Posted Apr 18, 2017 03:44 PM

    Defined a new EICLASS and added the correct logic to the event. I found info in the Installation and Configuration Guide and CA Workload Automation Agent for UNIX, Linux, or Windows User Guide. That is all I needed to get started.