

How Pega generates urls for different components
0
80
0
In Pega, URLs are generated to access different parts of an application, such as cases, tasks, or specific pages. Understanding how URLs are generated and structured in Pega can be important for debugging, integrating with other systems, or customizing user navigation.
1. Base URL: This is the root address of the Pega application. It typically includes the domain name and port number. For example:
http://pega-server:8080/prweb
2. Request Type: Specifies the type of request. Common types include 'activity', 'data', 'portal', etc.
3. Request Parameters: These are key-value pairs that specify what content or functionality is being requested.
URL Structure in Pega:
Here’s a basic structure of a Pega URL:
http://<server>:<port>/prweb/<component>/<action>?<parameters>
1. Case URL
When accessing a case, the URL often includes the case ID and other parameters. Here’s an example:
http://pega-server:8080/prweb/PRServlet?pyActivity=pxStartCase&pyCaseID=12345
"PRServlet" is the Pega servlet that processes the request.
"pyActivity" specifies the activity to perform, such as "pxStartCase".
"pyCaseID" is the identifier for the case you want to access.
2. Task URL
For accessing a specific task within a case, the URL might look like:
http://pega-server:8080/prweb/PRServlet?pyPortal=MyPortal
"pyActivity" is set to "pxProcessFlow" to process a task.
"pyTaskID" identifies the task you want to access.
3. Portal URL
To navigate to a specific portal or user interface:
http://pega-server:8080/prweb/PRServlet?pyPortal=MyPortal
"pyPortal" specifies the portal you want to access, such as "MyPortal".
Examples with Parameters
Case Creation URL
To create a new case, you might use:
http://pega-server:8080/prweb/PRServlet?pyActivity=pxCreateCase&pyCaseType=MyCaseType
"pyActivity=pxCreateCase" indicates that a new case should be created.
"pyCaseType" specifies the type of case.
Task Processing URL
To process a specific task:
http://pega-server:8080/prweb/PRServlet?pyActivity=pxProcessTask&pyTaskID=54321
"pyActivity=pxProcessTask" indicates processing a task.
"pyTaskID" identifies which task to process.
Pega URL Generation Mechanism
Pega uses its internal mechanisms to generate and handle these URLs. The generation is often tied to the Pega's API and the internal routing system. Here’s a brief outline of how Pega handles URL generation:
1. Routing Rules: Pega uses routing rules to determine how URLs are processed. These rules define the behavior for different types of requests.
2. URL Patterns: Pega applications often use URL patterns that are predefined in rules, such as the "PRServlet" in the examples.
3. Dynamic Parameters: Parameters such as "pyActivity", "pyCaseID", and "pyTaskID" are dynamically inserted into URLs based on the context of the request.
4. Session Management: Pega URLs handle session management through cookies and session tokens to ensure that requests are correctly associated with user sessions.
In Pega 8.x version you can find the below rule where you can configure the url
Rules Explorer --> Technical --> URLMappings
Map the required values in the URLMappings rule.
Click on settings of URL alias for each row and update the values accordingly.
You may also visit this link https://docs-previous.pega.com/reference/87/defining-url-patterns-work-items
Understanding URL generation in Pega is key for efficient application management and integration.
Related Posts
