Configuring dynamic references to external systems by using the Global Resource Settings feature
When you migrate applications from one server or environment to another, references to the external systems that those applications connect to, such as endpoint URLs and JNDI servers, might change. By using the Global Resource Settings feature, you can set values for these references without hard coding them into your application.
The following task describes how to create the classes, properties, data transforms, and data pages required to implement the Global Resource Settings feature. As a best practice, create application settings and reference the settings in your fields. Application settings provide a simple model for storing and organizing the environment-specific settings in your application. Use Global Resource Settings only for fields that do not support application settings. For more information, see Creating an application setting and Categorizing application settings.
Beginning in Pega Platform 8.5, you can use the Pega-provided D_pxGetApplicationSettingValue data page to fetch the values for specific application settings in the fields that support Global Resource Settings. For a list of supported fields, see Fields that support the Global Resource Settings syntax.
For example, to obtain a value from an application setting, use the following syntax: =D_pxGetApplicationSettingValue[OwningRuleset:"PegaUnitTests:01-01-01",Purpose:"URLSetting"].pySettingValue
If you use the D_pxGetApplicationSettingValue data page, skip steps 2 through 5 in the following task.
- Determine the references to external systems that will use the Global Resource Settings feature. For a list of supported reference types, see Fields that support the Global Resource Settings syntax.
- Create a class to hold the references to external systems. These
references are also known as environment properties. A page of that class becomes the data
page for the application. For more information, see Creating classes.
- Create the environment property for each reference to an external system. Pega Platform includes standard embedded classes and default properties for each rule form that supports the Global Resource Settings syntax. For more information on how to create a property, see Properties.
- Set the values of the environment properties. As a best practice, use a data transform to store these values. You must create at least one data transform to assign values to the environment properties. For more information, see Configuring a data transform.
- Create a data page rule that references the class from Step 2 and the data transform from Step 4. The data page brings the environment property rules together with the values that are stored in the data transform, and writes those property/value pairs to the clipboard. For more information, see Creating a data page.
- After you have set up the values for your Global Resource Settings, use the Global
Resource Settings syntax to refer to these values when entering references to external
systems.PageName is the name of the data page that you created in step 5, and PropertyName is one of the properties that you created in step 3. For example, if you want to use the Global Resource Settings syntax to refer to a SOAP Service Endpoint URL, and your data page is named MyDeclarativePage, the reference is =MyDeclarativePage.pySOAPURL. At run time, the reference resolves to the value of the pySOAPURL property that is located on the specified data page.
Previous topic Viewing application settings Next topic Embedded classes and default environment properties