Superclass feature
Developers can make Data Transforms 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 runtime, Pega Platform™:
- Identifies the parent of the current class
- Identifies the next level parent until the highest parent class is located
- Finds the Data Transform
- Invokes Data Transforms
In the following image, click the + icons to learn more about each part of the runtime process:
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.
Note: The Superclass feature is enabled if App Studio created default fields automatically.
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. Click the + icons to learn more about each Rule execution step:
Note: For more information on improving the maintainability and extensibility of your application, see Application modularization, encapsulation, and naming for better reuse and maintenance.
Check your knowledge with the following interaction:
Configure the superclass feature for Data Transforms
To configure the superclass feature, in the Dev Studio workspace, 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.
Tip: You can override these default settings in the Case Type pyDefault Data Transform. For example, the Work- pyDefault work Urgency value is set to 10. If you want to prioritize Cases in your Case Type, you can change the default Urgency value for all new Cases to 40.
Check your knowledge with the following interaction:
This Topic is available in the following Module:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?