How to use a pre-defined Scripted Extension Point

Andrew Bettcher
Kilo Sage

I need to change the timeout value for the Walk-up Experience kiosks. This KB says that I can add a new system property and refer to it in the WalkUpUtil BUT, the WalkUpUtil is protected so I can't change it.

A colleague referred me to scripted extension points and when I looked, there is already one there called sn_walkup.WalkUpUtil.

I'm a little out of my depth but I think I can simply use this to achieve my requirement but I don't really know what to do. The extension point has this code in it:

	getSessionTimeoutInterval: function() {
		//Returns {number} timeout - Half the system session timeout value formatted in milliseconds.
	},

So, do I simply copy the corresponding code from the script include and change the system property name (after adding my custom property)?

If I'm right, it would look like this:
 

getSessionTimeoutInterval: function() {
	//Returns {number} timeout - Half the system session timeout value formatted in milliseconds.
sessionTimeout = gs.getProperty('MY_NEW_PROPERTY', DEFAULT_TIMEOUT);
},

 

For some reason the WalkUpUtil halves the value (?) so I need to remember to double it so I get my full timeout but, will that work? It's kind of hard to test without waiting for it to time out and the proposed value is 10 hours!!


 

1 ACCEPTED SOLUTION

Extension points are used, just not for/in the getSessionTimeoutInterval function.

View solution in original post

3 REPLIES 3

-O-
Kilo Patron
Kilo Patron

I don't know why that KB suggests creating an extension point as the WalkUpUtil script include does not offer the possibility to overwrite/extend the function the reads the OOB property.

But why don't you just modify the OOB property?

This would change the timeout across the entire system. We only want the walk-up application to have a 10 hour timeout.

It seems weird that ServiceNow would recommend something in a KB that isn't possible and also that they'd create a default extension point that can't be used.

Extension points are used, just not for/in the getSessionTimeoutInterval function.