Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Appendix B: Creating new entities

Updated on December 13, 2021
Pega Government Platform Implementation Guide

What are PGP entities?

PGP entities are a collection of robust data structures that model data elements that are commonly used in government processes. The PGP entities are persistent data classes that come pre-configured as a part of PGP.

  • Person
  • Business
  • Vehicle
  • Facility
  • Household

Entity data structures serve two distinct purposes within PGP: first, Entity instances are persisted to a data store like any local data type or data table; second, Entity data classes are used as a type for embedded pages defined on the PGP work ancestor to support case processing.

Persistent Data Store

An entity data class (Data- class) is managed (curated) in an independent data store (database table) by the Add, Update, View and Search case types (Work- classes).

Case Type embedded page

An entity data class is also used as a type for embedded pages incorporated into the PGP work ancestor. These embedded pages are used by the PGP component processes to implement PGP features.

PGP Entities follow a pattern of Persistent Data curated by Business Processes. This pattern allows for the possibility that in a customer implementation the entity datastore may be mapped to customer resource that is external to Pega and PGP. In this pattern a persistent datastore descended from PegaPS-Data-Entity is added, updated, viewed, and searched by Case Types descended from PegaPS-Work-Entity.

New entity overview

This guide will step through the process of extending the PGP Entity data structure adding a new entity called Item built in a PGP implementation layer.

In the following examples PGPImp is the organization name of the implementation application and DemoPGP is the name of the implementation application. The class PGPImp-DemoPGP-Work inherits (directed) from the PegaPS-Work class.

Creating the persistent datastore
PGPImp-DemoPGP-Data-Entity-Item
  • Properties relevant to the entity
  • View(s) for editing, reviewing
  • Data Pages for retrieving
  • Optional: Case match rule to avoid duplicates, and validation rules for data
Extending the work class properties
In the primary work class of the implementation application, PGPImp-DemoPGP-Work, add a page property of type PGPImp-DemoPGP-Data-Entity-Item to hold Item data during case management processing.
Creating the data management case types

PGPImp-DemoPGP-Work-Entity-Item-Add

PGPImp-DemoPGP-Work-Entity-Item-View

PGPImp-DemoPGP-Work-Entity-Item-Search

PGPImp-DemoPGP-Work-Entity-Item-Update

Enabling for App Studio

Use views and design templates to construct the user interface.

Catalog the new Entity’s rules in Relevant Records so they will appear in the App Studio smart prompts.

Configure whether case types will appear on +Create nav.

Development steps

While it is possible to do some of this work in App Studio, the approach discussed here is based on a Dev Studio experience. App Studio hides some development details, like class names and rulesets, to present a development environment that can focus on case types and business processes, but for this exercise we need full control over those details.

Creating persistent datastore
Create a persistent data type and supporting rules for the new entity.
Creating data type ancestor
Add an abstract data class to the implementation layer to leverage the Enterprise Class Structure pattern and provide extension points for reusable rules common to the Entity implementation layer data types.
  1. To create a new class, click Create > SysAdmin > Class.
  2. In the Label field, enter Entity.
  3. In the Class Name box, enter or select PGPImp-DemoPGP-Data-Entity.
  4. Click Create and open.
  5. In the Select class type list, select Abstract.
  6. In the Settings section, in the Created in version box, enter or select the current version.
  7. In the Class inheritance section, in the Parent class (Directed) box, enter or select PegaPS-Data-Entity.
  8. Click Save.
Creating data type
Create the new Item data type and supporting rules.
  1. In the navigation pane of Dev Studio, click Data types.
  2. Click Options > Add data type.
  3. In the Add Data Type dialog box, click New Data Type.
  4. In the Label field, enter Item.
  5. In the Description field, enter an appropriate description for the class.
  6. Expand Advanced section.
  7. In the Parent class box, enter or select PGPImp-DemoPGP-Data-Entity.
  8. Click Submit to create the new data type and open it for editing
  9. On the Data model tab, use the Add field button to add properties the Item data type
    1. Add a property named EntityID of type Text.
    2. Add a property pyID of type Text.
    3. Continue adding properties as desired to define the Item data type.
    4. Save the data type.
  10. Switch to the Sources tab and click Create a local source.
    1. Click Submit to create a local source for the Item data type.
    2. Save the data type.
  11. Switch to the Views tab and create the UI for the new data type.
  12. Click Create new view name the view ItemDetail with Applies-To of PGPImp-DemoPGP-Data-Entity-Item.
    1. Place all the fields from the Item data type.
    2. Click Submit to save the view.
  13. Click Create new view name the view ItemDetailRO with Applies-To of PGPImp-DemoPGP-Data-Entity-Item.
    1. Place all the relevant properties from the Item data type, with the Presentation -> Edit Options set to Read-Only.
    2. Click Submit to save the view.
  14. Save the Data type.
Extending the Work Ancestor Class
Add a Page property to the implementation layer work ancestor of type PGPImp-DemoPGP-Data-Entity-Item to hold an Item instance during case management processes. The new embedded page will hold (contain) an instance of the new data class embedded on the work.
  1. To add a new property, click Create > Data Model > Property.
  2. In the Label field, enter Item.
  3. In the Apply to box, enter, or select PGPImp-DemoPGP-Work.
  4. Click Create and open.
  5. On the General tab, in the Property type section, click Change.
  6. Click Single Page.
  7. In the Page definitionbox, enter or select PGPImp-DemoPGP-Data-Entity-Item.
  8. Click Save.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us