Event Queue Order of Execution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 10:37 PM
I have a series of events that I need to process in order. This article states there's a "scheduled jobs periodically read the event queue", but does not mention the order of that event handling.
With the event log table being called Queue everywhere, does that mean events are being handled in order of event record creation?
I think even if the event queue considers the order of event execution, events will start in order, but not necessarily wait for one to finish for the second to start processing. Is that correct?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2017 10:51 PM
Hi Michel,
Events are asynchronous and processed based on how they are added in the event log table and each event requires different processing depending on what they process. The event queue log also shows you the time taken to process an event which can give time at it was completed.
You can delay an event call by using gs.eventQueueScheduled to schedule an event at a particular time, here is a sample of it
http://wiki.servicenow.com/index.php?title=Creating_a_Simple_Reminder_Email#gsc.tab=0
Thank You
Please Hit Like, Helpful or Correct depending on the impact of response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 05:35 PM
Hi Alikutty,
Thanks for your answer. gs.eventQueueScheduled is helpful to know!
But I want these events to be chained; whenever one ends, the other should start, without specifying when the event is to fire. I guess I may need to build a custom queue for this.
Thanks.
Michel