cancel
Showing results for 
Search instead for 
Did you mean: 

Need to clear all the pending events using redwood script

Former Member
0 Kudos

Hi,

I need to clear all the pending events using redwood script on action(post session or pre session).

Thanks in Advance.

Thanks

Deepan..

Accepted Solutions (0)

Answers (2)

Answers (2)

Dallas1
Explorer
0 Kudos

This is what we use (To clear single events)... You could adapt this to get a list of all events if necessary, and clear all of them.

public void ClearEventComplete(String event)
{

    SchedulerSession jcsSession=ScriptSessionFactory.getSession();
    if(jcsSession ==null)
      throw new RuntimeException ("ERROR: jcs session is NULL");

    EventDefinition ev = jcsSession.getEventDefinitionByName(event);
    if(ev==null)
      throw new RuntimeException("ERROR: Unable to get Event Definition");

    try{
      ev.clearAllPending();
      ev.clear();
      jcsSession.persist();
    }
    catch(Exception e)
    {
       throw new RuntimeException(e.toString());     
    }

}
0 Kudos

Can you please provide a sample script as well if we would like to clear all events in Complete/Raised status?

basv
Explorer
0 Kudos

Do you plan to clear all events of 1 specific Event Definition?

Or all events from all event definitions in the system ?

Former Member
0 Kudos

I need to clear one specific Event definition(all pending Events).