Skip to main content

Creating a Case from a file Data Set

4 Tasks

45 mins

Pega Platform '24.2
Visible to: All users
Advanced
Pega Platform '24.2
English

Scenario

MDC wants to grow its business significantly by partnering with other subsidiaries. To register partners and facilitate this growth, MDC plans to implement file integration. The objective is to handle JSON files, process incoming registration requests, and set up partner registration Cases. Your task is to use the current folder where JSON files are stored.

The following table provides the credentials you need to complete the challenge:

Role User name Password
Admin admin@deliveryservice rules

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Identify design options

There are two options to implement the given requirement:

  • Option 1: Use a Data Flow to read the messages from the repository and create a Case.
  • Option 2: Use a file listener to process the incoming files and create a Case.

2 Evaluate design options

The following table outlines the pros and cons of two design options for implementing the given requirement:

Design Pros Cons
Data Flow

It can process multiple files at a time using partitions and threads, and the leader node distributes tasks to various partitions.

  • Only repositories are supported. There is no support for directly accessing a folder structure.

  • Cannot delete or displace files after processing is complete.

File listener

It can process files from the given folder structure and displace them to another location after complete processing.

  • Does not support processing files present in cloud repositories.
  • Cannot process multiple files simultaneously.

3 Recommend the best design option

A Data Flow is the preferred option for parallel processing with higher efficiency.

A repository API can handle file displacement.

4 Implement solution details

  1. In the Pega Platform instance for the challenge, enter the following credentials:
    1. In the User name field, enter admin@deliveryservice.
    2. In the Password field, enter rules.
  2. In the navigation pane of Dev Studio, click Records > Data Model > Data Set, and then create a Data Set record configuration that reads the JSON files from an existing folder on the Pega server:
    1. In the Label field, enter Create Partner From File.
    2. In the Type list, select File.
    3. In the Context list, select Delivery Service.
    4. In the Apply to field, enter MDC-DS-Work-Partner.
    5. Click Create and open.
  3. Configure the file repository details:
    1. In the File location section, select Files on repository.
    2. In the Configuration section, in the Repository configuration field, enter or select defaultstore.
    3. In the Path section, select Use a file path to import or export data.
    4. In the File path field, enter /StaticContent/global/ServiceExport/*.json.
    5. Click Save.
File repository data set configuration.
  1. In the navigation pane of Dev Studio, click Records > Data Model > Data Flow, and then create a Data Flow record to read the JSON files from the repository that uses the Data Set and outputs the messages to the Create Case:
    1. In the Label field, enter Create Partner From File.
    2. In the Context list, select Delivery Service.
    3. In the Apply to field, enter MDC-DS-Work-Partner.
    4. Click Create and open.
Create Partner Data flow from file.
  1. Click Save.
  2. Configure the source configurations for CreatePartnerFromFile Data Flow Rule:
    1. In the Import data from section, in the Source list, select Data set.
    2. In the Data set field, enter or select CreatePartnerFromFile.
    3. In the Data set type filed, select File.
    4. Click Submit.
Source configurations of data flow rule for using file data set.
  1. Click Save.
  2. Configure the destination configurations for CreatePartnerFromFile Data Flow Rule:
    1. In the Output data to section, in the Destination list, select Case.
    2. In the Case list, select Partner.
    3. In the Add mapping section, in the Set field, enter or select BusinessPartner.
    4. In the equal to field, enter or select BusinessPartner. 
    5. Click Submit, and then click Save.
Destination configurations of data flow rule for using file data set.
  1. Run the CreatePartnerFromFile Data Flow Rule by clicking Actions > Run, and then click Run.
Create partner from file data flow run.

The system begins processing the Data Flow Run:

Execution of Create partner from file data flow.
Note: In the Pega lab environment and the virtual machines provided in the introductory part of this course, only background nodes are accessible. You should choose a background node rather than a batch node. However, in a real-world setting, it's necessary to utilize a batch node. 

Confirm your work

  1. Click Actions > Run to load JSON files into the folder to create Partner Cases that uses the PublishFileToRepository Rule.
PushFileToRepository utility rule.
  1. Navigate to the Data Flow run instance to view the statistics.
Successful execution of data flow using file data set.
  1. In the navigation pane of Dev Studio, click App > Partner to view or open the Partner Case instances. 
Partner case instances created from file data set.
  1. Confirm that you can see the details of the Partner Case.
Partner case instance created from file data flow rule.


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