Superclass feature
Data Transforms can be made more modular by using a superclass. You can combine several Data Transforms using the superclass feature to set values at multiple levels of the class hierarchy. Taking advantage of this feature improves the maintainability of Data Transforms.
When the superclass feature is enabled on Data Transforms, at run time, Pega Platform™ identifies the parent hierarchy up to the highest class, locates the relevant Data Transform, and then invokes the Data Transforms.
Match the numbers to the following image to learn more about each part of the run-time process:
1. System identifies the parent of the current class: Pega Platform identifies the parent of the current class by using standard Rule resolution. Rule resolution is an algorithm that is built into Pega Platform that identifies the correct Rule to use at run time, based on factors such as Ruleset, class inheritance, and permissions.
2. System identifies the highest parent class: After Pega Platform identifies a parent class, the system continues to identify parent classes until it reaches the highest parent class.
3. System finds the Data Transform: After identifying the highest parent class, the system uses Rule resolution to find the Data Transform that has the same name as the current Data Transform.
4. System invokes the Data Transforms: The Data Transform in the highest class is invoked first. The Data Transform of the same name (if any) in the second-highest class is invoked next, and so on. The current Data Transform is invoked last.
Data Transform superclass feature use case
Consider a Claim class with a Home subclass. The Home subclass, in turn, has a Rental subclass with Data Transforms at each level that sets the default values. You set your Data Transforms so that common default values are set in the Claim class, and specific values are set in the subclasses.
The Case Type requires two fields found in parent classes: the Date of loss and the Address fields.
You set the SetDefault Data Transform on each class so that the common default values for Date of loss and Prefix (Case ID prefix) are set in the Claim class, the Address is set in the Home class, and Name on lease is set in the Rental class.
The following image shows how the SetDefault Data Transform is applied across the class hierarchy:
The following image shows the Rule execution sequence of SetDefault Data Transforms that are invoked when Case Type Rental is created and the superclass feature is enabled on all Data Transforms. Match the numbers to learn more about each Rule execution step:
1. SetDefault is called in the Claim class to set the Date of Loss and Prefix fields.
2. SetDefault is called in the Home class to override the Prefix field and set the Address field.
3. SetDefault is called in the Rental class to override the Prefix field again and set the Name on lease field.
Check your knowledge with the following interaction:
Configure the superclass feature for Data Transforms
To configure the superclass feature, create a Data Transform with the same name at each class level and ensure the Call superclass Data Transform option is selected on the desired Data Transform. If properties are specified in both the parent and subclasses, the Data Transform in the subclass overrides the Data Transform in the parent class:
Pega Platform comes with standard pyDefault Data Transforms in the work classes from which the Case Types inherit. The standard Work- pyDefault Data Transform sets property values that are used in all Case Types. The properties include work status, work Urgency, and operator organization information.
Check your knowledge with the following interaction: