To process cases, Pega Platform™ applications use data objects to collect related case data. A data object is a template for describing an entity, such as a person or an item, by grouping a set of related fields.
For example, an application might contain an Account data object that you can use in two case types: one that allows the customer to transfer funds between bank accounts, and one that allows the customer to change the address that is associated with their account. The Account data object includes fields that describe an account, such as Account Number, Current Balance, and Next Statement Date. Referencing the Account data object avoids the need to define account-related fields for each case type.
You can use a data object as many times as needed in your application. In the preceding example, the Transfer Funds case type can use the Account data object to model both the source and target accounts for the transfer.
The collection of case types and data objects in your application holistically defines the data model for your application.
Tip: When designing a data model, use data objects to organize business data needed to process the case. As a best practice, the case type should only include case metadata—fields that describe the case and case operations, such as the creation date and the person or persons assigned to any open tasks. Most case metadata is collected automatically by Pega Platform, using system properties inherited by the case type. You can define additional metadata fields as needed.
Within each data object, a data type represents the technical implementation for the data object, such as the names and types of fields used to capture and present information about the entity. Collectively, the different fields represent a single type of object and define the structure of the data object. When you create a data object, Pega Platform automatically creates the corresponding data type.
Note: In Dev Studio, developers work directly with the underlying data type, not with the data object. As a result, you may find the terms data object and data type used interchangeably on projects and documentation.
For example, an HR application includes a case type to manage job requisitions and process applicants for open positions. To process a new candidate, HR must gather basic information about the candidate. To collect information about a candidate for an open job requisition, a developer can create a Candidate data object, with a corresponding data type that includes fields such as First name, Last name, Email, and Phone.
In addition to grouping data elements, data objects can group views and other rules related to the data object. For example, the Candidate data object can include a calculation to combine a given name and surname into a full name for the candidate, such as John Smith.
You can extend the structure of a data object by referencing other data objects. When one data object references a second data object, the fields in the second data type become part of the data type of the referencing data object. Referenced data objects can be used either once or multiple times, depending on the need.
For example, the Candidate data object also needs to include fields for information such as a mailing address and employment history. The address and employment history can be configured as data objects referenced by the Candidate data object. The Address data object extends the Candidate data object with fields such as Street name, City, and Postal code, while the Employment history data object adds fields such as Start date, End date, Position, and Employer. The Address data object is used once to capture a single address, while the Employment history data object can be used more than once to create a list of prior employers for the candidate.
In the following image, click the + icons to learn more about the relationship between a data object and the corresponding data type.
You can create data objects to reuse assets from an existing data object through inheritance. For example, Person is a generic data object, or a parent data object, while Customer and Call Center Representative (CCR) are more specialized data objects. To denote the relationship between parent and child data objects, use the Parent-Child pattern, for example, Person-Customer and Person-CCR. All three data objects have common fields, including Name, Telephone, and Email. By creating the common fields in the Person data object, you can reuse the fields in the Customer and Call Center Representatives data objects. The fields Tax Identification Number and Membership Number apply to customers only, so you define them in the Customer data object. Because the field Employee ID applies to employees only, you define the field in the Call Center Representative data object.
You can source data objects locally from a Pega Platform system of record, or you can source data objects from an external system of record, such as an HR or inventory database your company already uses. Alternatively, data objects can obtain data that you or a case participant enters or changes during application processing that are not associated with any system of record.
When you determine how to source a data object, consider the questions in the following image. The questions assume that you are new to Pega Platform and that you create an application from scratch.
In the following image, click + icons to learn about an example of each data object sourcing option.
Whenever possible, use standard, commonly-used data objects that Pega Platform provides, such as Address-Postal and Address-Email. You can also add relevant data objects to your application.
If a data object only partially meets your needs, you can extend that data object. For example, if you want to create the Employee data object, you can extend the existing Person data object to create the Person-Employee data object.
If a suitable data object does not exist yet, create a new one. For example, if you want to add the Airport Codes data object, but you cannot use or extend an existing data object, create a new one in Pega Platform.
Tip: If you add a new data object to the case workflow in App Studio, Pega Platform creates the data object as a draft object. A draft data object does not reference a data type. Draft objects allow the business to identify how and when data is used in the case life cycle, which may influence the design of the data type. You can add a data type to a draft data object by using the Data objects and integrations page.
Check your knowledge with the following interaction.