Delete event with groovy script in EPI (283 Views)
Reply
Advisor
MickyM
Posts: 33
Registered: ‎09-19-2010
Message 1 of 3 (283 Views)
Accepted Solution

Delete event with groovy script in EPI

Hi

 

I have a requirement where i'd like to delete an event from OMi after an EPI script has finished processing it.

 

I've looked through the API guides but can't seem to find any methods to allow me to do it.

 

Is this possible?

 

Thanks

Mick

HP Expert
Dmitry Shevchenko
Posts: 4,853
Registered: ‎01-30-2008
Message 2 of 3 (269 Views)

Re: Delete event with groovy script in EPI

Something like that should work:

 

def process(List<Event> events) {

    for (Iterator<Event> it = events.iterator(); it.hasNext();) {      

           Event event = it.next();       

          <do your event processing here for the event>     

            it.remove()     

     }   

 }  

Advisor
MickyM
Posts: 33
Registered: ‎09-19-2010
Message 3 of 3 (227 Views)

Re: Delete event with groovy script in EPI

Thanks, works great!

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.