As you process a case, you may need
to copy or manipulate data. For example, you collect an individual’s first name
and last name, but want to combine them into a full name.
Use data transforms in several ways:
Data Transforms
- When you create and process a case, you need data.
- You collect, process, act upon, and present that data back to the user.
- In a purchasing application, for example, items are added to a cart and the checkout process begins. The customer provides a shipping address and credit card information, and is prompted to provide a billing address.
- The shipping address might be the customer's home address. Reusing rather than having to reenter the shipping address is helpful and more efficient. Similarly, you might collect an individual’s first name and last name, but need to combine the two into a full name for credit card processing.
- One option for copying and manipulating data is the data transform.
Use data transforms in several ways:
Call a data transform from a flow
action rule or from a connector.
Use a special data transform rule (pyDefault) to
initialize property values when creating a case.
Data transforms can be used to
iterate over page lists or page groups, and copy entire pages at a time.
How to Set Values with Data
Transforms
In general, data transformation
involves mapping data from a source to a target as well as performing transformations on that data
required to achieve the intended mapped results.
Specify an action.
Actions are the individual
operations that are specified in each row
on
the Definition tab of a data transform.
Enter the Target, Relation, and Source.
The most important thing to
remember is to establish
the context correctly when reading and writing property values.
How to Set Values with Data
Transforms Example
- The first step checks if the billing address is the same as the shipping address.
- If the two addresses are the same, the shipping address is copied to the billing address.
- Otherwise, the billing address is set to empty values.
The pyDefault Data Transform
1. Pega applications use a data
transform to set initial property values when a case is created.
- For example, you set the date of loss in a claim case to the current date.
2. By convention, this transform is
named pyDefault.
- pyDefault has no specific characteristics, and the name is not reserved.
- You can create data transforms called pyDefault in any class or ruleset.
- Pega provides standard pyDefault data transforms in the work classes that case types inherit from.
- If you do not create a pyDefault for your case, the standard pyDefault in the inheritance path is invoked.
Data Transforms and Superclassing
- Use the superclass feature of a data transform to reuse data transforms at different levels in the class hierarchy.
- Superclassing combines the elements of each data transform. These include:
- Setting date of loss (in the Claim class)
- Setting address (in the Home class)
- Setting name on lease (in the Rental class)
When superclassing is
selected for a data transform, Pega:
- Identifies all the parent classes for the current class.
- Locates the data transforms with the same name in the current class and all parent classes.
- Invokes the data transform in the highest parent class first, followed by the second-highest, and continuing until returning to the data transform in the current class.
0 comments