System Event Registration (Registry) - Event should be UNIQUE

DirkRedeker
Mega Sage

Hi

I am wondering, why the system allows to create duplicated (multiple) similar records in the "Event Registry" (see screenshot below).

find_real_file.png

According to Docs Online, the Name of the Event is "UNIQUE", which is not validated by the system

find_real_file.png

 

 

Does anyone have an answer, why it is allowed to define several Events using the same name?

It this a missing validation, or is this for some good reason, that I do not understand right now?

 

Thanks a lot for your comments and feedback on this.

 

BR

Dirk

 

 

 

1 ACCEPTED SOLUTION

Hi Chris

 

Thanks for your comment. I tried out about your suggestion, and I saw the Event only fired once, in spite it was registered three times (see screenshots below)

I registered the Event "dirk.demoEvent" three times in the Global Scope:

find_real_file.png

 

I fired the Event ONCE using Scripts - Background:

find_real_file.png

 

The result in the Event Log shows only ONE Event created (which I expected to happen!)

 

find_real_file.png

 

 

As another test, I gave each of the created and registered Events a "Custom" queue (see screenshot below).

 

find_real_file.png

 

Firing the Event in Scripts - Background always took the Event Registered with the latest "created" date (see screenshot below):

 

find_real_file.png

The reason may be by accessing the database in some sorted order when selecting the registered Event, or by some caching reason. I cannot determine. So this behaviour may only

occur randomly like that.

 

Any further idea on this or any further comment may help the investigation.

 

Thanks and BR

Dirk

 

 

Just for Information: You can fire any Event name using the gs.eventQueue() function. Even Event Names, that are NOT registered.

Registering is just needed to trigger and react on Events written to the Event Log:

Below, you can see an "unregistered" Event, that I created in Scripts - Background:

 

find_real_file.png

 

View solution in original post

2 REPLIES 2

Chris35
Giga Expert

Could be interesting to here ServiceNows take on this, but you are correct about the behavior here.

Either way, only one event will be triggered regardless of how many events that exists in the Registry with the same name.
You could verify this in a Background Script :

gs.eventQueue("<event name", null, "<test>", "<test>");

Hi Chris

 

Thanks for your comment. I tried out about your suggestion, and I saw the Event only fired once, in spite it was registered three times (see screenshots below)

I registered the Event "dirk.demoEvent" three times in the Global Scope:

find_real_file.png

 

I fired the Event ONCE using Scripts - Background:

find_real_file.png

 

The result in the Event Log shows only ONE Event created (which I expected to happen!)

 

find_real_file.png

 

 

As another test, I gave each of the created and registered Events a "Custom" queue (see screenshot below).

 

find_real_file.png

 

Firing the Event in Scripts - Background always took the Event Registered with the latest "created" date (see screenshot below):

 

find_real_file.png

The reason may be by accessing the database in some sorted order when selecting the registered Event, or by some caching reason. I cannot determine. So this behaviour may only

occur randomly like that.

 

Any further idea on this or any further comment may help the investigation.

 

Thanks and BR

Dirk

 

 

Just for Information: You can fire any Event name using the gs.eventQueue() function. Even Event Names, that are NOT registered.

Registering is just needed to trigger and react on Events written to the Event Log:

Below, you can see an "unregistered" Event, that I created in Scripts - Background:

 

find_real_file.png