Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..
76 views

Fetching event properties in EPI script - Best practice?

Jump to solution

Hi,

We sometimes use EPI-scripts in OBM 2019.05 for manipulation of certain events and other functions. To fetch the event properties from the EPI-scripts, I have found that it is possible to do this in one of two ways, either by getting the properties directly from the event object or by means of a method.

E.g. to fetch the event Title both of these alternatives seem to work just as fine:

String myTitle = event.title
String myTitle = event.getTitle()

Which of these two alternatives is actually best practice (and potentially most effecient, performance wise)?

Which alternative do you use?

BR,
Frank Mortensen

 

 

1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

@FrankMortensen 

what you are showing is the "groovy-magic". All members can be accessed directly without getters (and also setters).

Java looks like this: String myTitle = event.getTitle()

But when you get used to groovy the following is much shorter: event.title (therefore I prefer using this .)

Besides that I have no details about performance. I assume that it does not matter from a OBM perspective... 😉

View solution in original post

2 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

@FrankMortensen 

what you are showing is the "groovy-magic". All members can be accessed directly without getters (and also setters).

Java looks like this: String myTitle = event.getTitle()

But when you get used to groovy the following is much shorter: event.title (therefore I prefer using this .)

Besides that I have no details about performance. I assume that it does not matter from a OBM perspective... 😉

View solution in original post

Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Whoa, grooovy!!

Thanks for shedding light on this, Harald 🙂

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.