4 Replies Latest reply on Jul 20, 2020 6:51 AM by Marouen Kahia

    How to stop File_Watcher job after ended Ok ?

    Marouen Kahia
      Share This:

      Hello Community,


      Maybe it's a simple question, but I don't have the answer in mind.

      How to stop File_Watcher job once the treatment has been finished Ok and start it at the next plan ?


      I explain:

      Job1 is a file watcher job, once executed and finished Ok, another Job2 is launched.

      Now, I want to stop everything until the next NewDay.


      How can i do it please ?


      Best regards,


      Marouen Kahia

        • 1. Re: How to stop File_Watcher job after ended Ok ?
          Lars Mahrendorf

          Hi Marouen Kahia

          Just a quick suggestion, I'm sure there are more elegant ways to do that, if you think about it longer.
          How about a Dummy Job before the filewatcher that sets a starting condition at the time the filewatcher has to start. The filewatcher deletes that starting condition, once he is finished. So you're done for the day.


          1. Dummy sets START_FILEWATCHER ODATE


          3. FILEWATCHER deletes IN-Conditione START_FILEWATCHER ODATE after completion.

          4. Job2 runs.

          • 2. Re: How to stop File_Watcher job after ended Ok ?
            Marouen Kahia

            Hi @Lars Mahrendorf

            Thank you for your reply.

            I am convinced that this is a condition removal action. What you suggested will do the trick and I will test it.

            But I need to do it without adding a new job to the chain.

            If you have other alternative, Let me know it please !


            Thanks again.


            Marouen Kahia

            • 3. Re: How to stop File_Watcher job after ended Ok ?
              Bentze Perlmutter

              Hi Marouen,


              It sounds like Job1 is a cyclic job?

              I.e. FW JOB1 runs every X minutes.

              If file is not found it starts again X min later.

              If file is found it triggers JOB2 and you don't want JOB1 to run anymore for that day.


              If this is the case, you can add an ON/DO statement for JOB1:


              On COMPSTAT=0 (which is the return code of FW when a file is found)

              DO Stop Cyclic


              With the above, when file is found JOB1 will go to ENDED OK and not run anymore.

              By default, all ENDED OK jobs get removed at New Day.

              So as long as JOB1 is scheduled to be ordered every day, the one from previous day will get removed and a new copy will be ordered and start as normal on the next day.


              NOTE: it is recommended that JOB1 as a Keep Active value set to 0 so that it gets removed at New Day even if it has not ENDED OK.




              1 of 1 people found this helpful