The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Using system properties to handle waiting condition in Workflow?

Zod
Giga Guru

Hi there,

I wonder if (and how) I could use some different (new) system properties to tell the workflow how long to wait for something .. which then easily could be changed ...

More detailed .. I have an escalation process that should wait for X days in the first round ... then Y days ... and finally Z days.

Instead of hard-coding this days into the workflow, I'd like to use some system properties entries ... so the values for X Y Z could easily be adjusted without requiring the workflow(s) to be changed.

Any help on this available?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Yes, you can do this. You need to use the Script field. Then you can use gs.getProperty() to get your property value.



http://wiki.servicenow.com/index.php?title=Timer_Activities#gsc.tab=0



A couple notes:


First, don't forget that properties come out as string values, so use parseInt() to convert it to an integer.


Second, the answer value in your script is in seconds, so if your property is in days, you'll want to multiply by 86,400.


View solution in original post

3 REPLIES 3

Chuck Tomasi
Tera Patron

Yes, you can do this. You need to use the Script field. Then you can use gs.getProperty() to get your property value.



http://wiki.servicenow.com/index.php?title=Timer_Activities#gsc.tab=0



A couple notes:


First, don't forget that properties come out as string values, so use parseInt() to convert it to an integer.


Second, the answer value in your script is in seconds, so if your property is in days, you'll want to multiply by 86,400.


Thanks Chuck!



I just read, that using the system properties is not really the best way of doing this ... so I think I will go an other path. But thank you!



Here it states that we better not use it in case the value is changing more often due to performance issues that might come up. So a custom table might be an good alternative ...


http://wiki.servicenow.com/index.php?title=System_Properties_Best_Practices#gsc.tab=0


Thanks for the update. You are right, properties are meant to be global in nature. They affect all users, make great default values, but should not be updated frequently. If you need to update the values on a weekly or daily basis (e.g. they are data driven and not adjusted as the process is reviewed/updated - ex: annually) then a lookup table is your better option.



FWIW, I wrote the best practice page you cited.