3 Replies Latest reply on Aug 16, 2018 11:50 AM by Andy Teo

    How send out email alert for cyclic job that has not finished at 2 specific timings

    Andy Teo

      I have a situation whereby I have one set of jobs that runs 2 times a day, one in the morning and the other in the afternoon.

      The last cyclic job will usually ends before 10am (for morning run) and 4pm (for afternoon run). If the last cyclic job ended after 10am and 4pm, we need to send out email alert.

      Previously, we used to have 2 sets of these jobs, hence we are able to set "notification before job completion" at 10am and 4pm on the last job of each set.

      Now that we have merged both sets of AM and PM jobs into one set of cyclic jobs, "notification before job completion" option is no longer usable because it doesn't work on cyclic jobs.

       

      Is there any other ways or workarounds that can fulfill the above requirement?

        • 1. Re: How send out email alert for cyclic job that has not finished at 2 specific timings
          Andrew Wong

          Andy,

           

          Here's a possible workaround--scan the job's output for the completion timestamp and send an email if the hour is 10 (10am) or 16 (4pm)?

          1. Add On-Do Action

          • Select On > Specific statement output
          • Statement = "Job finished 10:" (to catch jobs finishing between 10:00 and 10:59, add another On-Do Action for 4pm)
          • Select Do > Notify
          • Add notification details

           

          This isn't an ideal solution, just a workaround:

          • Requires the job's terminal output to include the timestamp. If it doesn't, the job may have to be changed to do that.
          • Might have to be updated if the output messages change.
          • 2. Re: How send out email alert for cyclic job that has not finished at 2 specific timings
            MunKeong Lee

            Hi Andy

            You should have retain your original 2 sets of jobs It's much easier to implement.

            Having said that, you may be able to workaround the issue by doing the following:

            1. Remove your current "Not finished by" notification from last cyclic job

            2. Create 2 non-cyclic dummy jobs: 1st one is for Morning Checkpoint and 2nd one is for Afternoon Checkpoint

            3. Schedule of Morning Checkpoint job is the same as the other regular jobs. "Not Finished by" time is set for morning.

            4. Schedule of Afternoon Checkpoint job is set to "None (Manual Order)". "Not Finished by" time is set for afternoon.

            5. Connect last cyclic job to both Morning Checkpoint job and Afternoon Checkpoint job.

            6. In On-Do action of Morning Checkpoint job, do the following:

                        On Job End Ok

                            Do Remove Condition <In Condition of Afternoon Checkpoint job>, Order Date

                            Do Order Job [Ignoring Scheduling Criteria] <Folder Name> <Name of Afternoon Checkpoint Job> Order Date

             

            When jobs are ordered for the current day, you will not see the Afternoon Checkpoint Job since the schedule is set to None. Once the Morning Checkpoint job is completed successfully, the Afternoon Checkpoint will be ordered due to On-Do action. You will then be able to see the Afternoon Checkpoint job and it's checking for "Not Finished by" based on afternoon criteria.

            Hope this helps.

            Regards,

            MK

            1 of 1 people found this helpful
            • 3. Re: How send out email alert for cyclic job that has not finished at 2 specific timings
              Andy Teo

              Thanks MunKeong! I tested your method and it's working and met my requirements.