Running a Decision Strategy using a Data Flow
5 Tasks
30 mins
Beginner
Pega Platform '24.2
English
Scenario
As a System Architect, you are tasked with creating a Data Flow that runs the NextBestLabel Decision strategy. The strategy is provided in your system in the Sample-Data-Customer class. The strategy must store its results in a data set in the Strategy Results class.
Use the following credentials to log in to the exercise system:
Role | User name | Password |
---|---|---|
System Architect | SystemArchitect | rules |
Your assignment consists of the following tasks:
Task 1: Create a Data Set in the SR class to output the strategy results
As a System Architect, create a new Decision Data Store type Data Set named NextBestLabelResults in the Strategy Results class to hold the results of the decision strategy.
Task 2: Create a Data Flow
Create a new Data Flow that runs the NextBestLabel strategy.
Task 3: Preview the records in the Data Flow
Preview data in the data set Customer component to validate that the strategy operation is successful.
Task 4: Run the Data Flow and observe the results
Run the Data Flow and confirm that the configuration is correct and that the decision strategy properly stores its results.
Task 5: Preview the strategy results in the output data set
Browse the output data set and review its contents. Use the Browse by keys function to view results for a specific customer.
Challenge Walkthrough
Detailed Tasks
1 Create a Data Set in the SR class to output the strategy results
- On the exercise system landing page, click Launch Pega Infinity™ to log in to Dev Studio
- Log in as a System Architect:
- In the User name field, enter SystemArchitect.
- In the Password field, enter rules.
- In the navigation pane of Dev Studio, click App to open the Application Explorer.
- In the Application Explorer, search for the Academy-Sample-SR class.
- Right-click Academy-Sample-SR, then click Create > Data Model > Data Set.
- On the Create Data Set Rule form, create a new Data Set:
- In the Label field, enter NextBestLabel Results.
- In the Type list, select Decision Data Store.
- In the Add to ruleset field, verify that ExerciseArtifacts 01-01-01 is selected.
- Click Create and open to save the new Data Set configuration.
- In the Keys section in the first field, enter .pySubjectID.
- Click Add key and in the new field, enter .pyLabel.
- In the upper-right corner, click Save to save the new Data Set configuration.
- In the upper-right corner, click Actions > Run.
- In the Run Data Set window, in the Operation field, select Browse.
- Click Run.
Note: In the Data Set Preview window, notice that the Data Set contains no records at this point.
- Close the Data Set Preview window.
- Close the Run Data Set window.
2 Create a Data Flow
- In the Application Explorer, search for the Sample-Data-Customer class.
- Right-click Sample-Data-Customer, then click Create > Data Model > Data Flow.
- On the Create Data Flow Rule form, create a new Data Flow:
- In the Label field, enter Strategy Results.
- In the upper-right corner, click Create and open.
- On the Edit Data flow: Strategy Results Rule form, complete the following settings:
- On the canvas, double-click the first shape to set up the source configurations.
- In the Source list, select Data set.
- In the Data set field, enter or select Customer.
- Click Submit.
- On the canvas, on the first shape, click Add > Strategy to add a new strategy component.
- On the canvas, double-click the unconfigured (- -) component to set up the strategy configurations:
- In the Strategy field, enter or select NextBestLabel.
- Click Submit to save the strategy component configuration.
- On the canvas, double-click the last component to define the output destination for the Data Flow.
- In the Destination field, select Data Set.
- In the Data set field, select NextBestLabelResults.
- Click Submit to save the component configuration.
- In the upper-right corner, click Save.
3 Preview the records in the Data Flow
- On the Data flow: Strategy Results Rule form, right-click the Customer Data Set, and then select Preview.
- In the Input Data Preview window, review the results:
- Click a few results and confirm that the customer data is available for the Age, CLV, and CustomerID properties.
Note: By default, the preview window shows a maximum of 10 records.
- Close the Input Data Preview window.
4 Run the Data Flow and observe the results
- On the Data flow: Strategy Results Rule form, in the upper-right corner, click Actions > Run.
- In the New: Data Flow Work Item window, click Submit to approve the Data Flow run configuration.
- In the upper-right corner, click Start to run the Data Flow.
- When the Data Flow completes, on the Component statistics tab, notice the records processing information through the NextBestLabel Strategy.
- Close the Data Flow run tab to return to the Data Flow canvas.
5 Preview the strategy results in the output data set
- On the canvas, right-click the NextBestLabel Results component and select Open data set.
- On the Data Set: NextBestLabel Results Rule form, in the upper-right corner, click Actions > Run.
- In the Run Data Set window, in the Operation drop-down list, select Browse.
- In the Maximum number of records to read field, enter 1000.
- Click Run to view the Data Set.
- Notice that the Data Set contains Strategy results for all input records.
- Close the Data Set Preview window.
- In the Operation drop-down list, select Browse by keys.
- In the Key column, select pySubjectID
- In the Value field, enter Customer-, and then the customer number, ranging from 1 to 1000, and click Run.
- In the Data Set Preview widow, notice that only one result for that specific customer is listed.
Available in the following mission:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?