Showing results for 
Search instead for 
Did you mean: 

Redwood Script for Raising Event for High Frequency Jobs

0 Kudos

Hello Experts,

This is in context with raising an event when the high frequency job fails 3 times consecutively in the last 24 hours. Kindly check and provide if there is any redwood script available for the same.

Thanks in Advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Active Contributor
0 Kudos


If you have the alerting module, also known as the active monitoring module, then you could easily specify a match for the process, in the alert action, you would check if there are more than two processes with status Error in the last 24 hours - if so, raise event.

Without the active monitoring module you would use a trigger that fires for processes from the definition in question reaching status Error; you check if there are two more processes in the last 24h from that process definition that failed and if so raise the event.

To get you started, look at:
Trigger example:
Query example:

You would want something like this:

//Match the process to be used

if (JobDefintion of process matches the one I want)
  String query = "SELECT COUNT(*) FROM Job WHERE"
  + "Job.RequestedStartTimeInternal > now('subtract 24 hours') "  
  + "and Job.JobDefinition in "  
  + "(select JobDefinition.UniqueId from JobDefinition "
  + "where JobDefinition.MasterJobDefinition = ?) ";  

  LongCallBack callback = new LongCallBack(1);  
    jcsSession.executeQuery(query, new Long[]  
    {  jcsJob.getJobDefinition().getMasterJobDefinition().getUniqueId()  }
     , callback);
  catch (Exception e)
  {  throw new RuntimeException(e);  }
  Long myCount = (Long) callback.getResult().get(0);
  if (myCount != null)  {  jcsOut.println(myCount);  }



0 Kudos

Thanks HP for guiding.