Skip to main content

Building a Decision Strategy

3 Tasks

40 mins

Visible to: All users
Beginner
Pega Platform '24.2
English

Scenario

As a Decisioning Architect, you are tasked with designing a basic decision strategy that outputs a Label Action with the lowest printing cost. A set of Label Actions created in the previous challenge are available for you in the Enablement business issue and Labels group. The printing cost of a label depends on:

  • A label-specific base cost.
  • The number of letters on the label.

To design the decision strategy, you must use the Proposition data, Set Property, and Prioritize components on the strategy canvas. Verify your work by testing the strategy.

Use the following credentials to log in to the exercise system:

Role User name Password
Decisioning Architect DecisioningArchitect rules

Your assignment consists of the following tasks:

Task 1: Import the Actions from the Enablement Business issue and Labels group

Create a new strategy canvas, and then add the Black Label and the Red Label Actions by using the Proposition data component.

Task 2: Set the CostofPrinting property for each Action

Use a Set Property component to set the CostofPrinting property for each Action. The system computes the cost of printing as base cost plus 5 times the number of letters from the label.

Task 3: Select the Action with the lowest printing cost

Use a Prioritize component to select the Action with the lowest printing cost.

Task 4: Confirm your work

Test the strategy that you created.

 

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 Import the Actions from the Enablement Business issue and Labels group

  1. On the exercise system landing page, click Launch Pega Infinity™ to log in to Dev Studio.
  2. Log in as a Decisioning Architect:
    1. In the User name field, enter DecisioningArchitect.
    2. In the Password field, enter rules.
  3. In the header of Dev Studio, click Create > Decision > Strategy.
    Dev Studio header menu
  4. On the Strategy Record Configuration landing page, in the text box field, enter Lowest Printing Cost to name the strategy.
  5. In the Business issue list, select Enablement.
  6. In the Group list, select Labels.
  7. In the Context section, in the Apply to field, enter or select Sample-Data-Customer.
  8. Optional: If the Development branch list is displayed, select No branch.
  9. In the upper-right corner, click Create and open to open the strategy canvas.
  10. On the canvas, right-click, and then select Import > Proposition data to add the component to the canvas.
  11. Right-click the Proposition data component, and then select Properties to configure the proposition data properties:
    1. In the Proposition data properties dialog box, in the Proposition data list, select Black Label.
    2. Click Submit to close the Proposition data properties dialog box.
  12. Repeat steps 10-11b to add the Red Label Action to the canvas.
    The Black Label and the Red Label on the strategy canvas

2 Set the CostForPrinting property for each Action

  1. On the canvas, right-click, and then select Enrichment > Set property to add the component to the canvas.
  2. Hover over a Proposition Data component, and then click and drag the gray arrow to connect it to the Set Property component.
  3. Repeat step 2 for the other Proposition Data component.
  4. Right-click the Set Property component, and then select Properties to configure the set property properties:
    1. In the Set property properties dialog box, in the Name field, enter Set Printing Cost.
    2. On the Target tab, in the Define Action, target, and source section, click Add item.
    3. In the Target field, enter .CostForPrinting, and then click the Open icon to open the Property Record Configuration page.
      Note: Notice that the value of the Apply to class is Academy-Sample-SR-Enablement-Labels.
    4. On the Property Record Configuration page, in the upper-right corner, click Create and open to edit the property Rule form.
    5. On the edit property form, in the Property type section, click change to change the property type.
    6. In the list, in the Single Value column, click Decimal.
    7. Click Save to save the property form.
    8. Close the property Rule form to return to the canvas.
  1. In the Set property properties dialog box, next to the Source field, click the Gear icon to open the Expression builder.
  2. In the Expression builder, enter .BaseCost + (5 *.LetterCount).
  3. Click the Test tab.
  4. In the BaseCost field, enter 10.
  5. In the LetterCount field, enter 5.
  6. Click outside the input field, and then verify that the Result is 35.
    Proposition data properties
  7. Click Submit to save changes to the expression.
  8. Click Submit to save changes to the Set Property component.

3 Select the Action with the lowest printing cost

  1. On the canvas, right-click, and then select Arbitration > Prioritize to add the component to the canvas.
  2. Hover over the Set Property component, and then click and drag the gray arrow to connect it to the Prioritize component.
  3. Right-click the Prioritize component, and then select Properties to configure the prioritize properties:
    1. In the Prioritize properties dialog box, in the Name field, enter Prioritize on Printing Cost.
    2. In the Expression field, enter or select .CostForPrinting.
    3. In the Order by section, select Lowest first.
    4. In the Output section, confirm that Top is the default selection, and then in the text box, enter 1.
    5. Click Submit to close the Prioritize properties dialog box.
  4. On the canvas, hover over the Prioritize component, and then click and drag the gray arrow to connect it to the Results component.
    Connecting the Prioritize component to the Results in the strategy
  5. Save the strategy.

Confirm your work

  1. In the upper-right corner of the canvas, click Check out.
  2. On the right, expand the Test run pane.
    Expanding the Test Run pane
  3. On the canvas, double-click to realign the strategy.
  4. In the Test run pane, click Save & Run.
  5. On the canvas, click the Set Property component, and then, in the Test run pane, in the Results section, check the value of the CostForPrinting property for both Actions.
  6. On the canvas, click the Results component, and then verify that the Action with the lowest printing cost is 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