
Creating a Case from a file Data Set
4 Tasks
45 mins
Pega Platform '24.2
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 |
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. |
|
File listener |
It can process files from the given folder structure and displace them to another location after complete processing. |
|
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
- In the Pega Platform instance for the challenge, enter the following credentials:
- In the User name field, enter admin@deliveryservice.
- In the Password field, enter rules.
- 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:
- In the Label field, enter Create Partner From File.
- In the Type list, select File.
- In the Context list, select Delivery Service.
- In the Apply to field, enter MDC-DS-Work-Partner.
- Click Create and open.
- Configure the file repository details:
- In the File location section, select Files on repository.
- In the Configuration section, in the Repository configuration field, enter or select defaultstore.
- In the Path section, select Use a file path to import or export data.
- In the File path field, enter /StaticContent/global/ServiceExport/*.json.
- Click Save.
- 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:
- In the Label field, enter Create Partner From File.
- In the Context list, select Delivery Service.
- In the Apply to field, enter MDC-DS-Work-Partner.
- Click Create and open.
- Click Save.
- Configure the source configurations for CreatePartnerFromFile Data Flow Rule:
- In the Import data from section, in the Source list, select Data set.
- In the Data set field, enter or select CreatePartnerFromFile.
- In the Data set type filed, select File.
- Click Submit.
- Click Save.
- Configure the destination configurations for CreatePartnerFromFile Data Flow Rule:
- In the Output data to section, in the Destination list, select Case.
- In the Case list, select Partner.
- In the Add mapping section, in the Set field, enter or select BusinessPartner.
- In the equal to field, enter or select BusinessPartner.
- Click Submit, and then click Save.
- Run the CreatePartnerFromFile Data Flow Rule by clicking Actions > Run, and then click Run.
The system begins processing the Data Flow Run:
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
- Click Actions > Run to load JSON files into the folder to create Partner Cases that uses the PublishFileToRepository Rule.
- Navigate to the Data Flow run instance to view the statistics.
- In the navigation pane of Dev Studio, click App > Partner to view or open the Partner Case instances.
- Confirm that you can see the details of the Partner Case.
Available in the following missions:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?