
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2019 08:34 AM
Hi
I am wondering, why the system allows to create duplicated (multiple) similar records in the "Event Registry" (see screenshot below).
According to Docs Online, the Name of the Event is "UNIQUE", which is not validated by the system
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2019 11:42 PM
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:
I fired the Event ONCE using Scripts - Background:
The result in the Event Log shows only ONE Event created (which I expected to happen!)
As another test, I gave each of the created and registered Events a "Custom" queue (see screenshot below).
Firing the Event in Scripts - Background always took the Event Registered with the latest "created" date (see screenshot below):
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2019 11:49 PM
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>");

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2019 11:42 PM
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:
I fired the Event ONCE using Scripts - Background:
The result in the Event Log shows only ONE Event created (which I expected to happen!)
As another test, I gave each of the created and registered Events a "Custom" queue (see screenshot below).
Firing the Event in Scripts - Background always took the Event Registered with the latest "created" date (see screenshot below):
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: