Skip to main content

Populating sample data using Monte Carlo data sets

5 Tasks

20 mins

Visible to: All users
Intermediate Pega Customer Decision Hub 8.8 Next Best Action Decision Management English
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Scenario

The U+ Bank project team built an implementation application of Pega Customer Decision Hub™ using the setup wizard, making use of the financial services data model. The initial sprint has begun, and the database team is building the integrations on the data warehouse, to build customer and account data into the structure that matches the data model in Pega. The integration work is in progress but currently there is no customer and account data in Customer Decision Hub. The lack of sample data is causing delays in development and unit testing because of the need to manually create test data.

As a decisioning architect, your role is twofold:

  • Reuse the SampleCustomerDataRecord Monte Carlo data set that is included out of the box and update it in line with the project requirements to populate high quality sample data.
  • Create a data flow to insert the customer and account records from the Monte Carlo data set into the customer and account database tables.

The Business team then provided you with additional requirements:

  1. After the data mapping workshop is completed, a new property was added to the customer class: GoPaperless. This property is used to determine if a customer has opted-in to paperless delivery for statements, and every customer must have the GoPaperless property populated as Y or N. To have a similar representation of the production data, business team wants 80% of the customers to have the GoPaperless property set to Y and 20% set to N.
  2. The customer account data must represent the actual product portfolio of the U+ Bank. The AccountSubtype property represents the types of different credit cards (Rewards, Standard, Plus,…) and ProductType represents the type of the credit card (Visa,…) that the customer uses. Other product types are not required in the initial phase of the project.

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: Prepare the SampleCustomerDataRecord Monte Carlo data set

Save the SampleCustomerDataRecord into the UBank-CDH-Data-Customer class in the implementation application. Reduce the sample size of the data set to one thousand. Update the .Accounts property of the credit card group to the .Accounts property in the UBank-CDH-Data-Accounts class. To simplify the output of the Monte Carlo data set, keep the credit cards data group and remove all other account groups from the Monte Carlo data set.

Task 2: Build an expression to generate data for the GoPaperless property

In the customer class, add the GoPaperless property as a new field to the Monte Carlo data set. Use the expression method to set the value of the property to Y or N.

Tip: You can use the if() function with randomTrueGenerator() function to build the 80/20 percent condition. For example: if(randomTrueGenerator(80),"Y","N").

Task 3: Update the Monte Carlo arguments for AccountSubtype and ProductType

Update the credit cards group in the Monte Carlo data set where the .AccountType is set to Credit card, and update the argument for .AccountSubtype and .ProductType to reflect the U+ Bank product portfolio. Use the following table to set the values for the AccountSubtype and ProductType:

AccountType AccountSubtype ProductType

Credit card

Rewards Card

Visa

Rewards Plus Card

Premier Rewards Card

Standard Card

Task 4: Create a data flow to insert data into Customer and Account tables

Create a new data flow which uses the SampleCustomerDataRecord Monte Carlo data set as the source and insert the records into the database using the Customer and Account data sets.

Task 5: Review the data that is inserted into Customer and Account tables

Use Profile Designer to see the generated sample data.

 

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 Prepare the SampleCustomerDataRecord Monte Carlo data set

  1. On the exercise system landing page, click Pega CRM suite to log in to Customer Decision Hub.
  2. Log in as the decisioning architect:
    1. In the User name field, enter DecisioningArchitect.
    2. In the Password field, enter rules.
  3. In the header of Customer Decision Hub, in the Search field, enter SampleCustomerDataRecord, then click the rule to open the Monte Carlo data set.
    Selecting the SampleCustomerDataRecord data set
  4. In the upper-right corner, click Actions > Save as.
    1. In the Apply to field, enter or select UBank-CDH-Data-Customer.
    2. In the Add to ruleset list, select CDH-Rules.
    3. In the upper-right corner, click Create and open.
      C
  5. In the Data set: Sample customer data record, configure the following settings:
    1. In the Define data set section, in the Size field, enter 1000.
      D
    2. In the Define groups section, in the first Group field, click the down arrow and select the Accounts page list in the UBank-CDH-Data-Customer class.
      U
      Note: Selecting the .Accounts page-list in UBank-CDH-Data-Customer class updates the Group class from PegaCDH-Data-FS-Account class to the account class of your application UBank-CDH-Data-Accounts.
    3. There are three more account groups defined in the data set. For the purposes of the exercise, delete the second, third and fourth account groups.
      1. In the upper-right corner of the group, where .AccountType is Mortgage, click Delete group.
        D
      2. In the upper-right corner of the group, where .AccountType is Deposit, click Delete group.
        D
      3. In the upper-right corner of the group, where .AccountType is Uplus airline cards, click Delete group.
        D
    4. In the upper-right corner, click Save.

2 Build an expression to generate data for the GoPaperless property

  1. On the top of the rule form, in the Define fields section, click the Add field, to add a new property.
  2. In the new line, configure the following settings:
    1. In the Field column, enter or select .GoPaperless.
    2. In the Method column, select Expression.
    3. In the Value column, on the right, click the gear icon to enter a new expression.
    4. In the Expression Builder, enter if(randomTrueGenerator(80),"Y","N")
    5. In the upper-right corner click the Test button.
    6. Validate that there is a Result ("Y" or "N").
      C
    7. Click Submit.
      G
  3. In the upper-right corner, click Save.
  4. In the upper-right corner, click Run to browse the data set.
  5. On the Run Data Set: Sample customer data record screen, select the following configuration elements:
    1. In the Operation list, select Browse.
    2. In the upper-right corner, click Run.
      B
    3. In the Data Set Preview window, confirm that the GoPaperless property has a value of "Y" or "N".
      R
    4. Close the Data Set Preview window.
    5. Close the Run Data Set: Sample customer data record window.

3 Update the Monte Carlo arguments for AccountSubtype and ProductType

  1. In the Define groups section, configure the following settings:
  2. In the row where Field is .AccountSubtype, in the Value list, enter or select Options.options(Text,Text,Text,Text).
    U
    1. In the Argument 1 field, enter Rewards Card.
    2. In the Argument 2 field, enter Rewards Plus Card.
    3. In the Argument 3 field, enter Premier Rewards Card.
    4. In the Argument 4 field, enter Standard Card.
  3. In the row where Field is .ProductType, in the Value list, enter or select Options.optionsCSV(Text).
    1. In the Argument 1 field, enter Visa.
      U
  4. In the upper-right corner, click Save.
  5. In the upper-right corner, click Run to browse the data set.
  6. On the Run Data Set: Sample customer data record screen, select the following configuration elements:
    1. In the Operation list, select Browse.
    2. In the upper-right corner, click Run.
    3. On the left pane click the + icons to locate a Result(x) record that has one Accounts(1) page.
      B

      The number of account records that the system generates uses the Monte Carlo method, so the number of records that you see can vary.
      N
    4. Click on any Accounts(1)(UBank-CDH-Data-Accounts) record to confirm that AccountSubtype, AccountType and ProductType have values.
      C
    5. Close the Data Set Preview window.
    6. Close the Run Data Set: Sample customer data record window.

4 Create a data flow to insert data into Customer and Account tables

  1. In the lower-left corner, click the Back to Customer Decision Hub button to return to Customer Decision Hub.
  2. In the navigation pane of Customer Decision Hub, click Data > Data Flows.
  3. In the upper-right corner, click Create.
  4. In the Create Data Flow screen, complete the following settings to create a new data flow:
    1. In the Label field, enter Insert Customer and Account Records.
    2. In the Apply to field, enter or select UBank-CDH-Data-Customer.
    3. In the Add to ruleset list, select CDH-Rules.
    4. In the upper-right corner, click Create and open.
      Create a new data flow
  5. On the canvas, double-click the first component to modify the source of the data flow.
  6. In the Source configurations window, set up the input data source:
    1. In the Source list, select Data set.
    2. In the Data set field, enter SampleCustomerDataRecord.
    3. Click Submit.
  7. On the canvas, click the Add branch button on the second component to add a new output destination.
    Add a branch to the data flow
  8. On the canvas, double-click the Customer component to modify the destination settings.
  9. In the Destination configurations window, set up the destination data source for customer records.
    1. In the Destination list, select Data set.
    2. In the Data set field, enter or select Customer.
    3. In the Save options section, select the Insert new and overwrite existing records radio button.
    4. Click Submit.
      Configure the Destination for customer
  10. On the canvas, click the + icon in the bottom of the branch shape and select Convert to add a new convert component.
    Add a Convert shape
  11. On the canvas, double click the [Convert] component.
    Edit the convert shape properties
  12. In the Convert configurations window, complete the following settings:
    1. In the Convert page on UBank-CDH-Data-Customer section, select the Embedded radio button.
    2. In the Select page(list) field, enter or select .Accounts.
    3. Click Submit.
      Add a embedded page
  13. On the canvas, double-click the unconfigured (- -) destination component after the Account convert component to set up the destination settings.
    Edit the last destination
  14. In the Destination configurations window, set up the destination data source for account page records.
    1. In the Destination list, select Data set.
    2. In the Data set field, enter or select Account.
    3. In the Save options section, select the Insert new and overwrite existing records radio button.
    4. Click Submit.
      Configure the Destination for account
  15. In the upper-right corner, click Save.
  16. In the upper-right corner, click Action > Run to configure the data flow run settings.
  17. On the New: Data Flow Work Item page, click Submit.
    Create a data flow run instance
  18. On the Data Flow Run DF-Test-1 page, in the upper-right corner, click Start to run the data flow.
  19. Confirm that the run completes.
    Data flow run completed
    Note: The number of Successful records varies for each data flow run.

5 Review the data that is inserted into Customer and Account tables

  1. In the navigation pane of Customer Decision Hub, click Data > Profile Data Sources to view the existing data sources.
  2. On the Profile Data Sources page, click Customer to open the customer data set.
  3. On the Data Set: Customer page, click the Records tab to confirm that the records are created.
    Browsing the customer records
  4. Optional: To confirm that the system imported the account records follow steps 2–3 for the Account data set.


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