Search code examples
guidewire

Script Parameters vs Runtime Properties


What is the difference between Script and Runtime Properties? The are both accessible from the runtime and they both have helper classes to get to them so i am not seeing a difference between the two. Is RTP just the newest version or is there some benefit from using them over SP


Solution

  • A major difference between Runtime Properties and Script Parameters is that Runtime Properties (new keys & values) can be imported dynamically without a server restart or a deployment whereas adding or removing Script Parameters needs a change to the XML and gosu enhancement files followed by a re-deploy. You can use the XML format below to import Runtime Properties in any environment by navigating to Administration > Utilities > Runtime Properties > Import.

    <?xml version="1.0"?>
    <Properties xmlns="http://guidewire.com/psc/properties">
      <Property>
        <Group>integration</Group>
        <Name>TestOne</Name>
        <Description></Description>
        <Value>Value</Value>
      </Property>
      <Property>
        <Group>integration</Group>
        <Name>TestTwo</Name>
        <Description></Description>
        <Value>Value</Value>
        <Value env="h2">Env/Value>
      </Property>
    </Properties>
    

    Notice how these can be categorized using Group and also vary for different environments which are defined by using the "env" identifier. You also don't need to explicitly define the type of the property and it is inferred automatically. Script Parameters on the other hand were the legacy way of achieving the same function and are probably still supported to maintain backward compatibility with older implementations dependent on them.

    To summarize, Runtime Properties is a smarter way of solving the same problem of having access to easily maintainable, exportable, and multi-environment configuration properties and should be the preferred choice while doing any new implementations.