Skip to main content

Simulating the truck rating response

5 Tasks

30 mins

Visible to: All users
Advanced
Pega Platform '24.2
English

Scenario

When the vendor registers a truck, the Executive Manager reviews it and decides whether to approve or reject it. If approved, the City Manager must then rank the companies that provide truck services for that city.

To rank these companies, the City Manager obtains the truck rating by inputting the VIN into an external system. The average rating of all trucks from a particular company serves as the company's initial rating. It's important to simulate the external truck system rating.

Simulating this rating involves setting up a test environment that replicates the behavior of the actual external system. A mock API  returns test data resembling the external system's behavior. The mock API can undergo configuration to provide varying ratings for different companies, which enables the City Manager to test the ranking process under different conditions.

After the simulation of the external truck system rating is in place, the City Manager can use the ratings obtained to rank the companies that deliver truck services for the city. The ranking can consider various factors, such as the average truck rating for each company, the number of trucks they operate, and their industry reputation.

Simulating the external truck system rating is crucial for ensuring the accuracy and reliability of the ranking process. By developing a test environment that mirrors the actual behavior of the system, the City Manager can evaluate the ranking process under different scenarios through precise and dependable data.

The following table provides the credentials you need to complete the challenge:

Role User name Password
Admin admin@deliveryservice rules

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Identify design options

Option 1

Enable the Simulate data source checkbox on the Data Page, and then create a Data Transform to simulate the response.

Simulate-Truck-Rating

Option 2

Associate a simulation activity with the rest connector.

Simulation activity.

Option 3

Create a REST service and get a rating for this service.

2 Evaluate the design options

In the following table, review the pros and cons of each design approach:

Design approach Pros Cons
Simulate data source
  • Easy to configure.
  • Can be sourced as Data Transform, Report definition, lookup, and activity.
  • You need an unlocked Ruleset version unless managed by a When Rule that specifies when to refer to a simulated data source and a dynamic system setting set to true when it is needed to call a simulated source.
Connector simulation activity
  • Can control the applicability of the simulation activity, whether it applies to a particular requestor session (user session) or all requestors sessions (global).
  • You must associate the connector simulation activity with a Ruleset version.
Create REST service
  • More control is needed to manage the endpoint URL (actual service or simulated service).
  • You need more development effort to create and consume a completely new REST service similar to the actual service.

3 Recommend the best design option

In this scenario, simulate the data source because it is easily configurable and has multiple source options.

4 Identify required configuration tasks

  1. On the Data Page that invokes the connector, toggle the simulation on.
  2. To set the rating, update the source to a Data Transform or an activity.

5 Review the solution details

  1. Log in to the Pega instance for the challenge:
    1. In the User name field, enter admin@deliveryservice.
    2. In the Password field, enter rules.
  2. Switch to the MDC application.
  3. In the GTRS data type, locate the Retrieve truck rating Data Page.
  4. In the row for the Data Page, click More > Toggle simulation, as shown in the following figure:
Toggle the simulation for the Data Page.
Note:  You can also select the Simulate data source checkbox in Dev Studio, as shown in the following figure:
Simulate data source checkbox.
  1.  To set the truck rating and other required properties, update the source to a Data Transform or an activity.

Confirm your work

      



Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

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

Pega Academy 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