Referencing a script parameter in Gosu

You can access a script parameter in Gosu through the globally accessible ScriptParameters object. Within Gosu, you access a parameter by using ScriptParameters.paramname.

For example, the following Gosu code determines if it is more than five days past an activities due date:

gw.api.util.DateUtil.daysSince( Activity.EndDate ) > 5

You can, instead, create a script parameter named EscalationTime, set its value to 5, and rewrite the line as follows:

gw.api.util.DateUtil.daysSince( Activity.EndDate ) > ScriptParameters.EscalationTime
Note: Guidewire recommends that you use script parameters only for global values that need to be periodically modified through the PolicyCenter Administration tab. If a global value is to be set and modified in code only, Guidewire recommends that you use Gosu class variables.