Skip to main content
LinkedIn
Copied!

Table of Contents

URL Mappings troubleshooting FAQs

This article provides answers to Frequently Asked Questions about URL Mappings. The article also outlines the concept of Canonical URL and the utility of URL Mappings.

Introduction

Canonical URL

URL Mappings

Answers to Frequently Asked Questions

Introduction

Unreadable components such as AccessGroup hash, Thread name, and so on in the Pega URLs make it difficult to share the URLs. It is challenging to share the URLs because of the following reasons:

  • The URLs are ugly and lengthy.

  • The URLs provide too much internal information.

  • The URLs are complex and difficult to comprehend.

  • The URLs do not copy and paste well because of the dependency on the space availability.

  • The URLS do not help in Search Engine Optimization (SEO).

In such cases, Canonical URLs that are simple, short, meaningful, and self-explanatory may be used. To support Canonical URLs (Simple URLs), Pega has developed a new Rule type, URLMappings (Records > Technical > URL Mappings).

Canonical URL

A Canonical URL is the URL of the page that the browser considers as the most representative from a set of duplicate pages on the site. For example, if there are a number of URLs for the same page (for example, example.com?dress=1234 and example.com/dresses/1234), the browser selects one as Canonical. Note that the pages do not need to be absolutely identical; minor changes in sorting or filtering of list pages do not make the page unique (for example, sorting by price or filtering by item color).

URL Mappings

The URL Mappings rule defines simple URL patterns that can be used in an application for the work items (cases), reports, landing pages, and so on.

You can represent your work items with simple and short URLs so that you can easily share the work items with other users of the same Pega Platform application. Simple, meaningful, and readable URLs make it easier for users to collaborate.

You can also specify the patterns to generate Canonical URLs for your case types. Canonical URLs improve Search Engine Optimization because they prevent duplicate content issues by indicating the preferred (standard) URL version. By generating Canonical URLs for a case type, you can make all instances of this case type searchable by third-party search engines.

Each application can have only one URL Mappings rule. The rule name is always Default.

Answers to Frequently Asked Questions

I have created URL Mappings. What is the reason for the failure of my Simple URL?

URL Mappings is a rule where only one instance exists for a ruleset. If you have access to multiple rulesets and the URL Mappings instance is created in multiple rulesets, the instance of the first ruleset is selected.

A Canonical URL (Simple URL) fails because of the following reasons:

  • If the environment is a multitenant environment, Pega does not support Canonical or Simple URLs.

  • The URL Mappings instance resolved during runtime differs from the instance that has the Mapping definition.

How to determine which URL Mappings instance is picked?

Only one instance of URL Mappings can be created in one ruleset. Hence, the mapping of the instance that is created might be different from the one that is selected during run time.

To determine the instance that is chosen, perform the following procedure:

  1. Create an activity in Dev Studio.

  2. Add URLMappingsPage with class name as Rule-URLMappings in Pages & Classes.

  3. Add the Obj-Open step with URLMappingsPage as Step page and .pyRuleName=’pyDefault’ as keys.

  4. Add Show-page step with Step page as URLMappingsPage.

  5. Run the activity. Verify if pyRuleSet and pyRuleSetVersion are present in the result. Simple URLs present in the pyDefault rule in pyRuleSet and pyRuleSetVersion are selected at run time.

 

An activity for Obj-Open and Show-page with URLMappingsPage as the Step page
Select Obj-Open for Method and URLMappingsPage for Step page. Enter Show-Page for the When input field with URLMappingsPage for Step page.
An activity for Obj-Open and Show-page with URLMappingsPage as the Step page

 

URLMappingsPage with class name as Rule-URLMappings in Pages & Classes
Set the Page name to URLMappingsPage and Class to Rule-URLMappings.
URLMappingsPage with class name as Rule-URLMappings in Pages & Classes

 

Activity results showing pyRuleSet and pyRuleSetVersion
Simple URLs are picked at run time from pyRuleSet (ruleset) and pyRuleSetVersion (version) that are highlighted.
Activity results showing pyRuleSet and pyRuleSetVersion

 

How to verify if an environment is a multitenant environment?

An environment is multitenant if the value of the pyIsMT property on the pxAdminSystem Clipboard page in System pages is true. This is illustrated in the following figure:

Determining if an environment is a multitenant environment based on the value of the pyIsMT property
The value of the pyIsMT property under System pages on the pxAdminSystem Clipboard page is true. This indicates the environment is a multitenant environment.
Determining if an environment is a multitenant environment based on the value of the pyIsMT property
URL Mappings or Simple URLs are not supported in multitenant environments.

Where is the mapping defined for the Canonical URL generation?

Add the Canonical URL definition in the URL Mappings instance.

For information regarding the mapping defined for the Canonical URL generation, see the following articles:

How to find the Canonical URL for a given class?

Use the SimpleURL.pxGetSimpleURLByClass Rule Utility Function (RUF) to find the Canonical URL for a particular class. Use the SimpleURLpxGetSimpleURLByAlias RUF for a Simple URL by URL alias.

Canonical URL can be obtained by the following two ways:

  • Using SimpleURL.pxGetSimpleURLByClass RUF

  • Using SimpleURLpxGetSimpleURLByAlias  RUF

Using SimpleURL.pxGetSimpleURLByClass RUF

Generate Simple URL using the Clipboard page.

The SimpleURL.pxGetSimpleURLByClass RUF runs the following steps:

  1. Accepts the Clipboard page

  2. Fetches the appropriate URL Mappings by matching the Clipboard page’s class name (pxObjClass) with the associated classes

  3. Generates Simple URL by replacing the Clipboard property values

This RUF accepts the following two parameters:

  • Clipboard page that is used to generate Simple URL

  • A Boolean value that indicates if there is a requirement to generate absolute form of Simple URL

Using SimpleURLpxGetSimpleURLByAlias RUF

Generate Simple URL using the alias name provided and the Clipboard page.

The SimpleURLpxGetSimpleURLByAlias RUF runs the following steps:

  1. Accepts the alias name and the Clipboard page

  2. Fetches the appropriate URL Mappings by matching the alias name provided

  3. Generates Simple URL by replacing the Clipboard property values

This RUF accepts the following three parameters:

  • Alias name of URL Mappings

  • Clipboard page that is used to generate Simple URL

  • A Boolean value that indicates if there is a requirement to generate absolute form of Simple URL

The RUF returns a short URL if you have any URL Mappings defined with the alias name provided. If not, the RUF returns null.

Is it possible to work with different work objects using Simple URLs on different tabs of a browser?

Any work object can be accessed by Simple URLs. Issues occur when you edit different work objects that are open on different tabs of a browser. This happens because the Simple URLs work on the Standard thread. Pega has addressed this issue in Pega 8.5 and later releases by opening Simple URL in a random thread content instead of using the Standard thread. 

Did you find this content helpful?

100% found this useful


Related Content

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us