Honored Contributor.
Honored Contributor.
421 views

EPI script skip using getInternalScriptError()

Has anyone been able to get the script host to skip EPI scripts using getInternalScriptError()?

As I understand it, if you add a public method named getInternalScriptError() and the method returns a value of 10 or higher, the script is skipped by the platform service executing the script.

https://docs.microfocus.com/itom/Operations_Bridge_Manager:2018.11/OMi/ExtGuide/Groovy/Scripts-EPI

Should be pretty simple. Add the following to the top of the class def:

int internalScriptError = 0;
def int getInternalScriptError() { return internalScriptError; }
def setInternalScriptError() { internalScriptError++; }

Then call setInternalScriptError() as needed to increment the value of internalScriptError. If  >= 10, the script is supposed to be skipped until the issue is resolved and internalScriptError < 10.

I have tried several tests and have not yet gotten it to work.

Thanks!

0 Likes
1 Reply
Highlighted
Honored Contributor.
Honored Contributor.

Re: EPI script skip using getInternalScriptError()

I'm not sure this operates as described in the docs. Adding the getInternalScriptError() method did cause the scripting host to "skip" the script if it had generated an error since it was last loaded/enabled. However, setting the value of internalScriptError >= 10 within the script did not have the same affect.

For my purposes the observed behavior meets my need.

The only indication I saw that the script was not actually being run was duration of 0 ms shown in opr-scripting-host.log.

 

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.