Skip to main content

Calculating fields using decision tables

2 Tasks

15 mins

Visible to: All users
Beginner Pega Platform '23 Case Management Constellation English


GoGoRoad stakeholders want to ensure customer satisfaction by allowing the application of discounts based on whether the service provider is on time or late. Customers are offered a greater discount based on how late the service provider arrived. You are directed to add a calculated field to the Review service summary Step in the Assistance Request Case Type. The calculation is based on a decision table.

Note: The framework of this challenge uses the Constellation architecture of Pega Platform™. To practice this challenge on the Traditional UI architecture, see the Calculating fields using decision tables version 8.8 challenge.

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

Role User name Password
Application Developer author@gogoroad pega123!
Note: Your practice environment may support the completion of multiple challenges. As a result, the configuration shown in the challenge walkthrough may not match your environment exactly.

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

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

Challenge Walkthrough

Detailed Tasks

1 Add fields to the data model

  1. In the Pega instance for the challenge, enter the following credentials:
    1. In the User name field, enter author@gogoroad.
    2. In the Password field, enter pega123!.
  2. In the navigation pane of App Studio, click Case Types > Assistance Request to display the Assistance Request Case Life Cycle.
  3. In the top menu, click on the Data model menu tab.
  4. In the Data model page, click Add field to display a dialog box.
  5. In the Add field to Assistance Request dialog box, in the Field name field, enter On-time performance to name the field.
  6. In the Type list, select Picklist.
  7. In the Choices section, click Add choice to display an empty field.
  8. In the empty field, enter On time as a picklist value.
  9. Repeat steps 7-8 to add three additional picklist values: Up to 15 minutes late, Up to 30 minutes late, and More than 30 minutes late.
    Add On time performance field
  10. Click Submit & add another to submit the picklist values.
  11. In the Add field to Assistance Request dialog box, in the Field name field, enter Service credit to name the field.
  12. In the Type list, select Currency.
  13. Click Advanced, and then select the This is a calculated field (read-only) check-box.
  14. In the Function list, select Use decision table. The second list defaults to Custom decision table.
  15. To the right of the Custom decision table field, click the Gear icon to open the Evaluate service credit dialog box to build the decision table.
    1. In the Evaluate service credit dialog box, click Add columns to display the Add columns dialog box.
    2. In the Column list, select On-time performance. The Comparator value defaults to Equal to.
    3. Click Submit to define the first column of the decision table.
    4. Under the On-time performance column, click the empty cell, and then enter Up to 15 minutes late.
      Configuring a decision table to calculate a field
    5.  In the Return column, enter .ServiceTotal * .05.
    6. To the right of the first cell of the Return column, click Add row.
      Configuring a decision table to calculate a field. Adding a row
    7. Repeat Steps d-f to configure the decision table with the information from the following table.
      On-time performance Return
      Up to 30 minutes late .ServiceTotal * .1
      More than 30 minutes late .ServiceTotal * .25
      Otherwise 0
      Configured decision table to calculate a field
    8. Click Submit to close the decision table.  
  16. Click Submit to add the calculated field.
  17. Click Save to save your changes to the Data Model.


2 Create the View for the Review service summary Step

  1. Click on the Workflow menu tab to display the Assistance Request Case Life Cycle.
  2. In the Resolution Stage, click the Review service summary Step to open the Step properties pane on the right.
  3. In the Step properties pane, click Configure View to configure the Step View.
  4. On the Display tab, in the Edit View: Review service summary pane, click Add to add a field to the Review service summary View.
  5. Click Fields to display the fields available in your Data Model.
  6. Select On-time performance, Service credit and Service total.
  7. Click Add.
    Edit view Review service summary
  8. To the right of the Service credit field, click the Gear icon to open the Configure field: Service credit dialog box.
  9. In the Edit mode dropdown list, select Read-only.
    Image showing label value field of 'Service credit' and Edit mode of 'Read-only'
  10. Click Save.
  11. Repeat steps 8-10 for the Service total field.
    Review service summary edit view
  12. Click Submit.
  13. Click Save.

Confirm your work

  1.  In the Assistance Request Case Type, click Save and run to create a new Assistance Request Case.
  2. Advance the Case to the Enter customer information View and select [email protected] from the Customer ID list.
    Note: If you select a Customer ID with Gold coverage, the Invoice customer Process is skipped.
  3. Advance the Case to the Select services Step.
  4. In the Select services Step, in the Service list, select Gasoline.
  5. In the Quantity field, enter 20, and then click Submit.
    Select services View at runtime
  6. In the Review service summary Step, in the On-time performance list, select Up to 30 minutes late.
  7. Note the value of the Service credit field updates.
    Review service summary view with 30 minutes selected
  8. In the On-time performance list, select Up to 15 minutes late.
  9. Note the value of the Service credit field updates.
    Review service summary view with 15 minutes selected

This Challenge is to practice what you learned in the following Module:

Available in the following missions:

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