What are the various Data Types in Pega?

Data Types in Pega

Data types and activities are fundamental to Pega, an industry-leading BPM (business process management) and CRM (customer relationship management) platform; therefore, they help manage and manipulate data and define business processes.

Consequently, they help in managing and manipulating data and defining business processes.

Data Types

Data types in Pega are used to define and manage the data structure the application will use. In essence, they provide a blueprint for organizing and handling data efficiently. Moreover, they are similar to classes in object-oriented programming. Furthermore, they are similar to classes in object-oriented programming.

Key Data Types

1. Single Value (Properties)
  • Text: Holds string values.
  • Number: holds numeric values (integer, decimal).
  • Date: Stores dates.
  • Date Time: holds date and time values.
  • Boolean: holds true or false values.
  • Time of Day: Stores time of day values.
2.Complex Types
  • Page: Represents a single record or a complex data structure.
  • Page List: This represents a list of records or a collection of complex data structures.
  • Page Group: This represents a group of pages, typically keyed by a specific value.
3. Data Pages (formerly known as Declarative Pages)
  • Read-only Data Pages: Used to source data from external systems or databases. Consequently, these are typically cached and can be scoped to a requestor, node, or thread.
  • Editable Data Pages: Used to manage data within the application.

 

Data Types in Pega

Example of Data Type Definition

Customer data type

Properties:

  • Customer ID (integer)
  • FirstName (Text)
  • Last Name (Text)
  • Email (Text)
  • Address (page): contains properties like street, city, state, and zip code.
  • Orders (Page List): Contains properties like Order ID, Order Date, and Amount.
Order Data Type

Properties:

  • OrderID (Integer)
  • Order Date (Date Time)
  • Amount (Decimal)

The data type is just like a table, which will have data storage.

  • Data types were called “data “tables” in Pega 6 and before.
  • The storage capacity of the data tables is 10 KB.
  • Data types are more than that. To create a data type, we need to use the navigation below.
  • Go to Data Explore and choose Add Data Type.
  • Make sure that your data types Types created under data classes.
  • Data types must be derived from the OOTB class “Data-“.
Best Practices
  • Naming Conventions: By utilizing meaningful names for properties and data types, you enhance readability and maintainability. Additionally, this ensures clarity and coherence throughout your codebase.
  • Reusability: Define reusable data types and data pages to avoid redundancy.
  • Efficiency: Use data pages to cache frequently accessed data and improve performance.
  • Modularity: Break down complex data structures into smaller, manageable components.

When we create a data type, PRPC automatically creates the below components and rules.

It is going to create a concrete class under the data class.
  • Properties (which are like columns of a table)
  • A physical (dedicated) table gets created in the rule base.
  • Data base table mapping rules get created.
  • Data pages (List Type Pages, Page Type, and Save able).
  • Report defination

To know more about the name of the physical table created, open the Class Rule Form. Afterwards, you can navigate to the database tab to find relevant information. Additionally, you can explore further details by examining the properties of the class. Subsequently, you can gather additional information. Then, click on the test connection.

Done.

Data type classes are concrete classes that “do not belong to the class group.”.

Does not belong to the class group: This means the classes will not fall under the inheritance path of the class group; instead, they are global for multiple different class groups.

Class key: For every table, we can define one or more keys; those values are unique.

The class key(s) we can see in the class rule form.

If we want to access the content of data storage, we can use the below OOTB methods.

Obj-Save: It performs an insert or update.

Obj-Browse: It fetches multiple instances based on the class key.

Obj-Open: It fetches one single instance based on the class key.

Obj-Open-By-Handle: It fetches one single instance based on the primary key.

Obj-Delete: Delete instances.

Obj-Delete-By-Handle: Delete an instance by primary key.

Understanding table name prefixes (PC Table, PR Tables, PR4 Tables)

pc: Transaction Tables.

PR: These are like master tables or reference tables.

PR4: These are rule-related tables; all the rules get stored in PR4 tables.

Conclusion

By understanding and effectively using data types in Pega, developers can thus create robust, scalable, and maintainable applications that handle data efficiently. Consequently, this ensures better performance and reliability in data management.

Data Classes and Property Modes in pega

 

Leave a Comment