Skip to main content

Calculating fields using Decision tables

2 Tasks

15 mins

Visible to: All users
Beginner
Pega Platform 8.7
Case Management
English
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Scenario

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.

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 Create the view for the Review service summary step

  1. In the navigation pane of App Studio, click Case types > Assistance Request 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. In the view configuration dialog box, on the Fields tab, click Add field to add a field to the Review service summary view.
  5. In the field configuration window, 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.
    Picklist values
  10. Click Submit to submit the picklist values.
  11. In the menu on the left, click Fields to display the fields available in your data model.
  12. Hover over Service total, and then click the Plus icon.
  13. In the Options list, select Read-only.

2 Add calculated fields to the Review service summary view

  1. Click Add field to add a field named Service credit.
  2. In the Type list, select Currency.
  3. Click Advanced, and then select the This is a calculated field (read-only) check-box.
  4. In the Function list, select Use decision table. The second list defaults to Custom decision table.
  5. 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.
    Gear-icon
    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, double-click the empty cell, and then enter Up to 15 minutes late.
      empty cell
    5. In the Return column, enter .ServiceTotal * .05.
    6. To the right of the first cell of the Return column, click Add row.
      Add row to decision table
    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
      Service credit decision table
    8. Click Submit to close the decision table.
  6. Click Submit to add the calculated field.
  7. Click Submit to finish configuring the Review service summary view.
  8. Click Save to save your changes to the case life cycle.

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 Identify location step and enter an address.
    Note: If you do not specify a value in the State field, the Select service provider step does not display any service providers.
  4. Advance the case to the Select service provider step, and then click Select provider to select a service provider.
  5. In the Select services step, enter a quantity for at least one service, and then click Submit.
    Select services
  6. In the Review service summary step, in the On-time performance list, select More than 30 minutes late.
  7. Click Save to confirm that the value of the Service credit field updates.
    Review service summary view with More than 30 minutes late selected
  8. In the On-time performance list, select Up to 15 minutes late.
  9. Click Save to confirm that the value of the Service credit field updates.
    Review service summary view with up to 15 minutes late 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?

20% found this content useful

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