Strawberry1 Frequent Contributor.
Frequent Contributor.
389 views

Close event by groovy script

Hi Gurus,

I wrote a script which takes an event and verify the category. If the category is "Test" the event should be closed/archived/deleted/iqnore. In any case, It should not be seen in the Active Event Browser.

I try to use the remove() function, but that generate a error.  - No signature of methode: com.hp.opr.comon.epi.EpiEventImpl.remove() is applicable for argument types: () values: []

Which command is the best for me to use for not processing the event to the Active Event Browser.

Best regards,

Rode

 

0 Likes
3 Replies
Acclaimed Contributor.. Harald Acclaimed Contributor..
Acclaimed Contributor..

Re: Close event by groovy script

Hello,

please try this:

event.setState(LifecycleState.CLOSED);

Kind regards,
Harald

doubando Super Contributor.
Super Contributor.

Re: Close event by groovy script

you can simply use suppression rules on OMi to suppress event Category of "Test" or SBEC can work as well

Admin--> Operations Management.

groovy scripts makes a little load on the system based on how complex your script it is

0 Likes
Absent Member.. Aardbei Absent Member..
Absent Member..

Re: Close event by groovy script

Hello Harald,

Thanks for your reply. 

This is what I looked for. The only thing was missing in your post was the import. But I managed.

import com.hp.opr.api.scripting.LifecycleState;

Thanks,

Rode.

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.