Global resource setting (GRS) in Pega

Global Resource Setting in Pega (GRS) allows referencing external system values, port numbers, addresses, and URLs.We can avoid using fixed text values in rule forms. Application moves to different environments before it goes live like Dev, QA, Staging, and Pre-prod.When we migrate an application from one environment to another environment, external system references such as End Point URLs, JNDI names typically changes depending on the environment. We cannot log into each environment and update the rules with correct values or settings by unlocking rule sets, especially in Production. Global Resource Settings allows us to set values for settings that can vary depending on the environment without requiring the update of data instances and integration rules.

Let's take an example for Connector where we need an endpoint URL to connect the external system.

what is global resource settings in pega

If we do not configure GRS whatever URLs we have in pre-prod or lower environments will be moving to the Production environment where we have real EndPoint URLs, then we need to unlock the rulesets and update EndPoints with correct values. Sometimes we may miss updating the endpoints resulting in a delay in go live or issues in production.
To avoid this delay and risk we need to have GRS to hold all the values and settings so that we can easily migrate our code and make go-live success.


We are creating GRS for SOAP Connector for Currency Conversion which is already generated by Wizard.

Configure GRS in Pega

The syntax for global Resource Settings is 
=DataPageName.IntegrationPropName.FieldPropName

PageName           Name of the data page
FieldPropName -  One of the properties
Important steps to configure GRS
1. Create a class and dedicate this to the GRS configuration.
2. Create an environment page property.
3. Create a Data transform to set values to environment page properties.
4. Create a Data page that binds everything together.

1. Create a class and dedicate this to the GRS configuration.
    The purpose of a dedicated class is to hold all environment properties which represent external system reference. As a best practice create this class in the base class of integration like "Env".
what is global resource settings in pega

2. Create an environment page property.
Create a page for each environment reference. We have several environment references in pega like below:
Embed-Env-Connect-EJB
Embed-Env-Connect-HTTP
Embed-Env-Connect-JMS
Embed-Env-Connect-MQ
Embed-Env-Connect-SOAP
Embed-Env-Connect-JNDI
You can find all eligible environment classes that support GRS syntax here: Classes supports GRS
For SOAP Connector we will use "Embed-Env-Connect-SOAP" in page property.
page property in pega

3. Create a Data transform to set values to environment page properties.
This will be the source for the Data page and by using this Data Transform we will set values to those properties. Pega OOTB functions can be used to set values to the page properties from DSS (Dynamis System Settings).
If we hardcode the URL's in Data Transform, we need to unlock the rulesets and update the corresponding URL's in respective higher environments(eg: QA, pre-prod, Prod, etc), this will lead to manual errors and is not suggestable. To avoid this we Pega provides us DSS feature. DSS has no ruleset version we can simply open the DSS in prod and update our endpoint or whatever the value here.

Dynamic system settings in pega

dss in pega

@getDataSystemSetting("MyToInt","GRS/RateConv/CurrCheck")

4. Create a Data page that binds everything together.
    Create a data page to bind all the values together. As a best practice use integration to avoid confusion.

Data page screenshot

data page in pega
Finally how to reference in Connect SOAP:
We can refer service endpoint URL in the service tab of the Connect SOAP rule.
grs and datapage
Execution steps in runtime:
1. Connect SOAP is invoked.
2. Service endpoint URL is value referenced in the data page.
3. Data transform executes for the data page, if the page is not there in the clipboard
4. Data transform runs the function to get the value of a dynamic system setting.
5. Value in pyEndPointURL from CurrencyCheck page will be used by the SOAP connector to invoke the service.


2 comments:

  1. i am very thankful for this post

    ReplyDelete
  2. Thank you. Please read other posts and give your commets/questions.

    ReplyDelete