Saturday 8 September 2018

Setting Property Values Automatically

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.

Data Transforms
  1. When you create and process a case, you need data.
  2. You collect, process, act upon, and present that data back to the user.
  3. 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.
  4. 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.
  5. One option for copying and manipulating data is the data transform.
This example uses a data transform to copy the shipping address to the billing address page.
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
  1. The first step checks if the billing address is the same as the shipping address.
  2. If the two addresses are the same, the shipping address is copied to the billing address.
  3. 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
  1. Use the superclass feature of a data transform to reuse data transforms at different levels in the class hierarchy.
  2. 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:
  1. Identifies all the parent classes for the current class. 
  2. Locates the data transforms with the same name in the current class and all parent classes. 
  3. 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.


Load disqus comments

0 comments