on 11-22-2017 12:25 PM
Hi,
I need to clear all the pending events using redwood script on action(post session or pre session).
Thanks in Advance.
Thanks
Deepan..
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());
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you plan to clear all events of 1 specific Event Definition?
Or all events from all event definitions in the system ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.