Tuesday, September 3, 2019

Script Actions in ServiceNow

Script Actions :

  • Events can be fired from most of the server side script elements for processing later. i.e Async processing.
  • Script actions can be defined with the processing logic to process those events.
  • Events are processed when the processing capability available. 
  • Events are processed as user system
  • Events may be processed in parallel if there is enough processing capacity.   i.e Schedule workers and semaphores.
  • Events are defined on a table and script actions are defined on events.












Events can be triggered using, 

gs.eventQueue('procssed.load.event',gr, parmValue1,parmValue2);

Objects available in a script action: 

current  :  represents GlideRecord object of the record on which event is triggered

event : represents event parameter object.  two additional parameters can be processed to an event when it is being triggered and those parameters are accessed using event.parm1, event.parm2 in the script actions. 


Quick points: 


  1.  Event and script actions can be used to develop event driven async integrations.
  2.  Event and script actions can be used to defer the bulk crud operations processing to later point in time.
  3.  Avoid writing lengthy script action scripts, call script includes instead.








No comments:

Post a Comment

ITIL V4 foundation exam pattern

What is the purpose of ITIL V4 foundation? The purpose of ITIL V4 foundation is to introduce readers to the management of modern IT-enable...