CPSA - Certified Pega System Architect Data Validation and Transforms Questions and Answers 1 — Questions and Answers
Question 1: A developer needs to ensure that a user-entered Canadian Postal Code follows the 'A1A 1A1' format before the user submits a form. This validation should provide immediate feedback to the user on the client side. Which type of rule is the most appropriate and efficient for this requirement?
- An Edit Validate rule referenced on the property rule. (Correct answer)
- A Validate rule called from the flow action.
- A Data Transform that uses a regular expression function.
- A Declare Constraint rule to check the pattern.
Correct answer: An Edit Validate rule referenced on the property rule.
An Edit Validate rule is the best choice for client-side, field-level format validation. It uses Java code (often a regular expression) to check for a specific pattern and provides immediate feedback to the user as they input data, without waiting for a server round-trip. A Validate rule runs on the server side when the form is submitted. A Data Transform is for manipulating data, not for direct user input validation. A Declare Constraint is for enforcing relationships between property values across the entire work object, not for simple format validation.
Question 2: In a Pega application, a new case for a loan application must be initialized with several default values. For example, the 'ApplicationStatus' property should be set to "New", and the 'ApplicationDate' should be set to the current date. Which rule is the most appropriate for setting these initial property values when a case is created?
- A Validate rule
- An Activity
- A Data Transform (Correct answer)
- A Declare Expression
Correct answer: A Data Transform
Data Transforms are specifically designed to manipulate data, which includes setting default or initial values for properties when a case is created. They provide a simple, maintainable, and performance-friendly way to populate a data model. While an Activity could be used, it is considered a best practice to use Data Transforms for this purpose as they are more lightweight. Validate rules are for checking data integrity, and Declare Expressions are for automatically calculating a property value based on changes to other properties.
Question 3: A system architect is configuring a Data Transform. Which of the following is a valid action that can be used to copy data from a source page to a target page?
- Update Page
- Append and Map to (Correct answer)
- Call-Validate
- For Each Page
Correct answer: Append and Map to
The 'Append and Map to' action is used to copy a source page to the end of a target Page List or Page Group property. 'Update Page' is used to set properties on an existing page. 'For Each Page' is an iteration action, and while it can contain mapping actions within it, it is not a direct copy action itself. There is no 'Call-Validate' action; validation is typically invoked from flow actions or activities.
Question 4: A business requirement states that when a user submits a form for a new insurance claim, the 'DateOfLoss' must be on or before the 'DateOfClaim'. If the validation fails, the user must be prevented from proceeding and shown an error message. Where should a developer configure the validation to meet this requirement?
- On the property rule for 'DateOfLoss' using an Edit Validate rule.
- In the flow action that processes the form submission. (Correct answer)
- In a Data Page that sources the claim information.
- On the case type rule using a stage entry validation.
Correct answer: In the flow action that processes the form submission.
Validate rules, which are ideal for comparing multiple property values and enforcing business logic, should be called from the flow action that corresponds to the form submission. This ensures the validation logic is executed on the server when the user attempts to proceed, preventing the case from advancing if the data is invalid. An Edit Validate rule is for single-field format checking. A Data Page is for sourcing data, and stage entry validation occurs later in the process.
Question 5: Which statement accurately describes the primary purpose of a Data Transform in Pega?
- To define the user interface and layout of a form.
- To execute complex procedural logic and call external systems.
- To ensure a property's value conforms to a required pattern on the client-side.
- To initialize, copy, and transform data between pages or properties. (Correct answer)
Correct answer: To initialize, copy, and transform data between pages or properties.
The core purpose of a Data Transform is to manipulate data within the application. This includes setting default values, copying properties from one page to another, and transforming data from one format to another. User interfaces are defined by Sections, complex procedural logic often resides in Activities, and client-side pattern validation is the domain of Edit Validate rules.
Question 6: A developer needs to set the default currency to 'USD' for all new expense reports and also copy the user's 'ManagerName' from the OperatorID page to the '.ReportApprover' property on the case. Which rule and action combination is the most efficient way to achieve this?
- An Activity with two Property-Set methods.
- A Declare Expression for each property.
- A Data Transform using the 'Set' and 'Update Page' actions.
- A Data Transform using two 'Set' actions. (Correct answer)
Correct answer: A Data Transform using two 'Set' actions.
A single Data Transform can efficiently handle both requirements. One 'Set' action can be used to assign the literal value 'USD' to the currency property. A second 'Set' action can be used to copy the value from the OperatorID page (the source) to the '.ReportApprover' property (the target). This is the most direct and best-practice approach for this scenario.
A developer needs to ensure that a user-entered Canadian Postal Code follows the 'A1A 1A1' format before the user submits a form.
This validation should provide immediate feedback to the user on the client side.
Which type of rule is the most appropriate and efficient for this requirement?