Highlighted
Outstanding Contributor.
Outstanding Contributor.
647 views

Comparing all of the list elements to an Active List

Hi Everyone

I'm trying to implement a variable that will use the output of the StringToList variable and will compare all the elements of the list to an ActiveLIst

For example

targetUserName is

test1@test.com|test2@test.com|test3@test.com

I'll use the variable StringToList to get the output

"test1@test.com","test2@test.com","test3@test.com"

Now I can use the variable GetSizeOfList to get the value of how many objects are in the array (list)

I have an activeLIst which contains a key value (UserMail) , for example

UserMail               

test3@test.com

 

Now I'm interested to check which of the three emails are in the list for this I need to create a variable that checks all of the objects in the array

From the http://velocity.apache.org I can see that foreach loop is supported in velocity template however each of my attempts to create a velocity template variable with foreach gets a nullPointerException

Any ideas how to create this variable will be appreciated

Thanks in advance

Best regards

David

0 Likes
3 Replies
Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..

Maybe not so elegnant solution...

 To Execute Command action on the rule that passes the targetUserName to a script as a parameter, the script can then split the string at the"|", loop through the resulting list and reforward splited events as syslog, that should be queried again in a new Rule against Your e-mail active list....

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Hi David,

I  believe if you maintain 2 active lists data comparison then this will be easy.

 

Cheers

Gayan

Mr
0 Likes
Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..

Hi,
How can he populate active list from string of lyst type - variable syze (string1|string2|string3......)?

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.