cancel
Showing results for 
Search instead for 
Did you mean: 

Email notifications

former_member206885
Participant
0 Kudos

Hi All,

We are changing the status to completed of some SAP jobs, if a specific string is found in job logs by using post running action on the jobs. But email notifications are getting triggered. We are using the below trigger to send email notifications. Could you please help how can we modify the below trigger so not to send the email notifications for these type of jobs.

{  

             String strLogFileName = "";   

               if((jcsPostRunningContext.getNewStatus().equals(JobStatus.Error)     ||       

                   jcsPostRunningContext.getNewStatus().equals(JobStatus.Unknown)   ||       

                   jcsPostRunningContext.getNewStatus().equals(JobStatus.Killed))       

                  )    

             {                

                   {        

                          String email = "abc@ghi.com";        

                          String subject = "Redwood job abend";        

                          String strText = "Job id=" + jcsJob.getJobId().intValue() + ", Job name=" + jcsJob.getJobDefinition().getName() + ", Job Description=" + jcsJob.getDescription() + " , has abended";        

                          JobDefinition jd = jcsSession.getJobDefinitionByName("System_Mail_Send");    

                  {         

                         Job subJob = jd.prepare();         

                         subJob.getJobParameterByName("To").setInValueString(email);         

                         subJob.getJobParameterByName("Subject").setInValueString(subject);         

                         subJob.getJobParameterByName("Text").setInValueString(strText);         

                           }    

                        } 

                   }

   }

Regards,

Tinku

Accepted Solutions (1)

Accepted Solutions (1)

former_member206885
Participant
0 Kudos

Hi Experts,

Could you please suggest, is it possible to suppress the email notifications of the jobs which are changed to the status completed, if a specific string is found in the job log of the errored jobs?

We are on M33.120

Regards,

Tinku

gmblom
Active Contributor
0 Kudos

Hello,

The procedure that checks the output file and the trigger are firing in order and the trigger goes first.

The best you can do is merge the code from the post running action with your trigger.

Regards Gerben

former_member206885
Participant
0 Kudos

Thank you Gerben for giving clarity.

Regards,

Tinku

Answers (0)