Skip to main content

Using the Merge component

5 Tasks

30 mins

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

Scenario

In the Sample application, a data structure is created for insurance claim Case Type with the following structure.

Field Type Description

ClaimID

Identifier

Claim identifier

PolicyID

Text

Policy associated with the claim

DateOfClaim

Date

Date of the claim

FullName

Text

Full name of the insured

PhoneNumber

Text

Phone number of the insured

Email

Text

Email of the insured

Place

Text

Location of the incident

PrimaryCause

Text

Primary cause of the incident

FraudIndicator

Boolean

Indicates whether the policy was associated with a fraud incident in the last 6 months


A third-party agency provided you with a file of potential policies that were associated with fraud incidents in the last six months. The CSV file containing a list of PolicyIDs is loaded in the External Fraud File File Data Set. To store this new information as part of the claim data, the database team extended the Claims database table with a new field FraudIndicator and set its value the default values to "false" for all existing records in the database table.

As a one-off task, merge the data in the CSV file with the claim data in the database table to update the FraudIndicator to "true" for the PolicyIDs listed in the CSV file.

The following artifacts are configured for you:

Rule Type Description

Claims

Identifier

Claim Database Table Data Set

ExternalFraudData

Text

Decision Data Set to hold the External Fraud data

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 the Load External Fraud Data Data Flow

Create a new Data Flow: Load External Fraud Data in the Sample-Data-Claims class that loads the data from the External Fraud File file Data Set to a new Decision Data Set named External Fraud Data.

Tip: The merge component requires a Data Set that supports the "Browse by keys" operation such as a Database Table Data Set or a Decision Data Set for its secondary data source.

In the Data Flow, set the FraudIndicator field to "true" for all records. To set the value to "true", use a Convert component.

Tip: For data manipulation, use the Data Transform component in Data Flows. For quick data manipulation that involves basic operations, you can also use the Convert component by converting the incoming page, to the same page and using the mapping options.

Task 2: Run the Load External Fraud Data Data Flow

Run the Load External Fraud Data Data Flow with the default settings.

Task 3: Create the Merge External Fraud Data Data Flow

Create a new Data Flow: Merge External Fraud Data in the Sample-Data-Claims class that merges the data from the External Fraud Data Decision Data Set with the Claims Database Data Set.

Modify the Claims Data Set and add a PolicyID as a new key for the merge operation.

Finally, update the records in the claims database table with the updated new data.

Tip: You can use the same Database Table Data Set to read from and write to the database table.

Task 4: Preview the records in the Data Flow

Preview the data in each component, to validate that the compose operation is successful.

Task 5: Run the Merge External Fraud Data Data Flow

Run the Merge External Fraud Data Data Flow with the default settings and validate the final records in the Claims Database Data Set.

 

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 Load External Fraud Data Data Flow

  1. Log in as the system architect:
    1. In the User name field, enter SystemArchitect.
    2. In the Password field, enter rules.
  2. In the navigation pane of Dev Studio, click App to open the Application Explorer.
  3. In the Application Explorer, search for the Sample-Data-Claims class.
    1. In the Application Explorer, right-click on the Sample-Data-Claims class, then select Create > Data Model > Data Flow.
  4. On the Create Data Flow tab, create a new Data Flow:
    1. In the Label field, enter Load External Fraud Data.
    2. In the upper-right corner, click Create and open.
      Create and open
  5. On the Edit Data flow: Load External Fraud Data rule form, complete the following settings:
    1. On the canvas, double-click on the first shape to set up the source configurations.
      double-click
    2. In the Source list, select Data set.
    3. In the Data set field. enter or select ExternalFraudFile.
    4. Click Submit.
      Submit
  6. On the canvas, on the first shape, click Add > Convert to add a new Convert component.
    Convert
    Tip: To set the FraudIndicator, you can use a Convert shape. For more complicated mapping and data transformation, use the Data Transform component.
  1. On the canvas, double-click the – Convert component to set up the convert configurations:
    Convert 2
  2. In the Convert configurations, complete the following settings:
    1. In the Convert page on Sample-Data-Claims field, ensure that Top-level is selected.
    2. In the Into page(s) of class, enter or select Sample-Data-Claims.
    3. Click Add mapping.
    4. In the Target (Sample-Data-Claims) column, in the empty field enter or select .PolicyID.
    5. In the Source (External Fraud File) column, in the empty field enter or select .PolicyID.
    6. Click Add mapping.
    7. In the Target (Sample-Data-Claims) column, in the empty field enter or select .FraudIndicator.
    8. In the Source (External Fraud File) column, in the empty field enter or select "true".
      Source
    9. Click Submit.
  3. On the canvas, double-click the last component to set up the destination configurations:
  4. In the Destination configurations, complete the following settings:
    1. In the Destination list, select Data set.
    2. In the Data set field. enter or select ExternalFraudData.
      Note: ExternalFraudData is a Decision Data Store Data Set created by the System Architect, with the PolicyID as its Selectable key.
    3. In the Save options, confirm Save full record is selected.
    4. Click Submit.
    5. In the upper-right corner, click Save.
  1. Preview the data in the components:
    1. On the canvas, right-click the External Fraud File, then select Preview, to validate the PolicyID is loaded successfully.
      PolicyID
    2. On the canvas, right-click the Convert component, then select Preview, to validate the FraudIndicator is set to "true".
      FraudIndicator

2 Run the Load External Fraud Data Data Flow

  1. On the Data flow: Load External Fraud Data rule form, in the upper-right corner, click Actions > Run.
  2. On the New: Data Flow Work Item page, review the settings then, in the upper-right corner, click Submit.
  3. On the Data Flow Run page, in the upper-right corner, click Start.
  4. Confirm that the Data Flow run is successfully completed.
    run 1

3 Create the Merge External Fraud Data Data Flow

  1. In the Application Explorer, right-click on the Sample-Data-Claims class, then select Create > Data Model > Data Flow.
  2. On the Create Data Flow tab, create a new Data Flow:
    1. In the Label field, enter Merge External Fraud Data.
    2. In the upper-right corner, click Create and open.
  3. On the Edit Data flow: Merge External Fraud Data rule form, complete the following settings:
    1. On the canvas, double-click on the first shape to set up the source configurations.
    2. In the Source list, select Data set.
    3. In the Data set field. enter or select Claims.
    4. Click Submit.
  4. On the canvas, on the first shape, click Add > Merge to add a new merge component.
    merge10
  5. On the canvas, double-click the empty component to set up the source configuration for the secondary data source that will be merged with the primary data source:
    merge 11
    1. In the Source list, select Data set.
    2. In the Input class list, enter or select Sample-Data-Claims.
    3. In the Data set list. enter or select ExternalFraudData.
    4. Click Submit.
      submit 4
  6. On the canvas, double-click the [Merge] component to set up the merge configuration.
    1. In the Name field, enter Merge Fraud Data.
    2. In the Merge when all conditions below are met section, in the External Fraud Data column, select PolicyID.
    3. In the Merge when all conditions below are met section, in the Claims column, enter or select .PolicyID.
    4. In the Default path section, confirm that the Secondary path is selected.
      Caution: The selected path allows you to determine which source takes precedence when there are properties with the same name and contain different values. When the property has no value, the value is updated from the source with any available data.
    5. Click Submit.
      submit 5
  1. On the canvas, double-click the last component to set up the destination configurations:
  2. In the Destination configurations, complete the following settings:
    1. In the Destination list, select Data set.
    2. In the Data set field. enter or select Claims.
    3. In the Save options, select Insert new and overwrite existing records.
    4. Click Submit.
      submit 6
    5. In the upper-right corner, click Save.

4 Preview the records in the Data Flow

  1. On the Data flow: Merge External Fraud Data rule form, right-click the Claims data set, then select Preview.
    1. Browse through the Results() to confirm that all records have FraudIndicator set to false.
      FraudIndicator 2
    2. Close the Input Data Preview window.
  2. On the Data flow: Merge External Fraud Data rule form, right-click the External Fraud Data data set, then select Preview.
    1. Browse through the Results() to confirm that all records have FraudIndicator set to true.
      FraudIndicator 3
    2. Close the Input Data Preview window.
  3. On the Data flow: Merge External Fraud Data rule form, right-click the Merge Fraud Data component, then select Preview.
    1. Browse through the Results() to confirm that records are merged and FraudIndicator field is updated correctly.
      FraudIndicator4
    2. Close the Input Data Preview window.

5 Run the Merge External Fraud Data Data Flow

  1. On the Data flow: Merge External Fraud Data rule form, in the upper-right corner, click Actions > Run.
  2. On the New: Data Flow Work Item page, review the settings than, in the upper-right corner, click Submit.
  3. On the Data Flow Run page, in the upper-right corner, click Start.
  4. Confirm that the Data Flow run is successfully completed, then above the progress bar, click the MergeExternalFraudData link.
    MergeExternalFraudData
  5. On the Data flow: Merge External Fraud Data rule form, right-click the Claims Data Set, then select Open data set.
    select Open data se
  6. On the Data set: Claims tab, in the upper-right corner, click Actions > Run to open the Run Data Set: Claims window.
    1. In the run context, in the Operation list, select Browse.
    2. In the upper-right corner of the run context, click Run.
  7. Browse through the Results() to confirm, the data is successfully updated.
    Results 20


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