Skip to main content


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

Development steps

Updated on December 13, 2021

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.

Pega Government Platform Implementation Guide

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.

Creating Case Types

Manage or curate an entity data class (Data- class) in an independent data store (database table) by the Add, Update, View and Search case types (Work- classes).

Creating Abstract Support Work Classes
When a new implementation layer is generated by the New Application Wizard it only creates descendants for the selected concrete classes. Manually add the missing abstract work classes to leverage the Enterprise Class Structure pattern and provide extension points for reusable rules common to the Entity and Item implementation layer work 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-Work-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-Work-Entity.
  8. Click Save.
  9. Click Create > SysAdmin > Class.
  10. In the Label field, enter Entity Item.
  11. In the Class Name box, enter or select PGPImp-DemoPGP-Work-Entity-Item.
  12. Click Create and open.
  13. In the Select class type list, select Abstract.
  14. In the Settings section, in the Created in version box, enter or select the current version.
  15. In the Class inheritance section, in the Parent class (Directed) box, enter or select PGPImp-DemoPGP-Work-Entity.
  16. Click Save.
Creating Management Case Types
Manage or curate an entity data class (Data- class) in an independent data store (database table) by the Add, Update, View and Search case types (Work- classes).
  1. In the navigation pane of Dev Studio, click Casetypes.
  2. Click Add a case type.
  3. In the Name field, enter a name for the case type.
    Note: Choose the case type name carefully as it is used to form the work class name for the case type. After the case type has been created, you may choose to change the pyLabel for the case type rule to something more specific
  4. Optional: To change the inheritance model for this case type, expand the Advanced Settings section, update the Derives from (Directed) and Derives from (Pattern) inheritance settings, and then provide rulesets and ruleset versions.
  5. Click Submit.
The lists of ancestor classes to choose from may not show recently added abstract classes unless you have logged out since they were added or otherwise reset the cache.
Creating the Add Case Type
In PGP the Add case type for Entities collects data from the operator in a Page embedded on the work class. At an appropriate step in the case life cycle a PGP Persist component is placed which writes out the data from the embedded page on the work to a persistent data class using the persistence configuration from the Database Table rule for the embedded page’s class.
  1. In the navigation pane of Dev Studio, click Casetypes.
  2. Click Add a case type.
  3. In the Name field, enter Add.
    Note: You can change the label for the case type rule later
  4. Expand the Advanced Settings section.
  5. In the Derives from (Directed) box, enter or select PGPImp-DemoPGP-Work-Entity-Item as the directed ancestor.
  6. In the Derives from (Pattern) box, enter or select PGPImp-DemoPGP-Work-Entity-Item as the patterned ancestor.
  7. Click Submit.
  8. Create a workflow for the case type.
  9. On the Workflow tab, click Life cycle.
    1. In the default Create stage, click FORM STEP to add a Collect Information step.
    2. Enter Capture Item Details as the name for the step.
    3. Click Configure view.
    4. In the View Configuration add the Item field as a field group.
    5. Select ItemDetail from the View dropdown to use it as the View for the Item field group.
  10. Add a new Review stage.
    1. On the Workflow tab, click Life cycle.
    2. In the default Create stage, click FORM STEP to add a Collect Information step.
    3. Enter Review Item Details as the name for the step.
    4. Click Configure view.
    5. Use +STEP to add a Collection Information step under the Review stage named Review Item Details.
    6. From the step parameters panel (right) click Configure the View.
    7. In the View Configuration add the Item field as a field group.
    8. Select ItemDetailRO from the View dropdown to use it as the View for the Item field group.
    9. Use +STEP -> …More -> Processes and select Persist object.
    10. From the step parameters panel (right) configure the Persist object component.
      1. For Type use Entity
      2. For Property use “item” (double quotes are significant)
    11. Change the case type rule label for PGPImp-DemoPGP-Work-Entity-Item-Add from Add to Add item.
    12. Save the Case.
Creating the Update Case Type
In PGP the Update case type for Entities solicits changes to the entity data from the operator and captures these changes in a Page or Page List embedded on the work class. At an appropriate step in the case life cycle a PGP Persist component is placed which writes out the data from the embedded page on the work to a persistent data class using the persistence configuration from the Database Table rule for the embedded page’s class.
  1. In the navigation pane of Dev Studio, click Casetypes.
  2. Click Add a case type.
  3. In the Name field, enter Update.
    Note: You can change the label for the case type rule later.
  4. Expand the Advanced Settings section.
  5. In the Derives from (Directed) box, enter or select PGPImp-DemoPGP-Work-Entity-Item as the directed ancestor.
  6. In the Derives from (Pattern) box, enter or select PGPImp-DemoPGP-Work-Entity-Item as the patterned ancestor.
  7. Click Submit.
  8. Create a Workflow for the case type.
    1. On the Workflow tab, click Life cycle.
    2. In the default Create stage, click FORM STEP to add a Collect Information step.
    3. Enter Edit Item Details as the name for the step.
    4. Click Configure view.
      1. In the View Configuration add the Item field as a field group.
      2. Select ItemDetail from the View dropdown to use it as the View for the Item field group.
      3. Click Submit to save the view.
  9. Create a new Review stage.
    1. Click +STAGE to add a stage and enter Review.
    2. Click +STEP > Collect information and name it Review Item Details.
    3. From the step parameters panel (right) click Configure the View
    4. In the View Configuration add the Item field as a field group
    5. Select ItemDetailRO from the View dropdown to use it as the View for the Item field group.
    6. Click Submit to save the view.
    7. Click +STEP > More > Processes > Persist Object.
    8. From the step parameters panel (right) configure the Persist object component.
    9. For Type use Entity
    10. For Property use “.Item” (double quotes are significant)
  10. Change the case type rule label for PGPImp-DemoPGP-Work-Entity-Item-Update from Update to Update item.
  11. Save the case.
  12. Edit the pyDefault data transform rule for the Update work type to set the initial values on the .Item page from lookup data page.
    1. Switch to the Parameters tab and add a parameter named EntityID of type String
    2. Add a Set action to the transform definition.
    3. Use .Item as the Target.
    4. Use D_Item[pyID:Param.EntityID] as the Source.
  13. Save the data transform.
Creating the View Case Type
In PGP the View case type for Entities shows a comprehensive snapshot of an entity instance’s data.
  1. In the navigation pane of Dev Studio, click Casetypes.
  2. Click Add a case type.
  3. In the Name field, enter View.
    Note: You can change the label for the case type rule later.
  4. Expand the Advanced Settings section.
  5. In the Derives from (Directed) box, enter or select PGPImp-DemoPGP-Work-Entity-Item as the directed ancestor.
  6. In the Derives from (Pattern) box, enter or select PGPImp-DemoPGP-Work-Entity-Item as the patterned ancestor.
  7. Click Submit.
  8. Create a Workflow for the case type.
    1. In the name field of the Create stage, enter or select PegaPS-Work-Entity view from the list of available stage processes.
    2. Change the case type rule label for PGPImp-DemoPGP-Work-Entity-Item-View from View to View item.
  9. Click Save.
  10. Save the PegaPS.Details section as PGPImp-DemoPGP-Work-Entity-Item-View.Details.
    1. Include the section PGPImp-DemoPGP-Data-Entity-Item.Details using the Item property as the page context.
  11. Save the section.
  12. Edit the pyDefault data transform rule for the View work type to set the initial values on the.Item page from lookup data page.
    1. Switch to the Parameters tab and add a parameter named EntityID of type String.
    2. Add a Set action to the transform definition.
    3. Use Item as the Target.
    4. Use D_Item[pyID:Param.EntityID] as the Source.
  13. Save the data transform.
Creating the Search Case Type
In PGP the Search case type collects filter criteria from the user and retrieves a list of matching entities which may then be selected for further processing.
  1. In the navigation pane of Dev Studio, click Casetypes.
  2. Click Add a case type.
  3. In the Name field, enter Search.
    Note: You can change the label for the case type rule later.
  4. Expand the Advanced Settings section.
  5. In the Derives from (Directed) box, enter or select PGPImp-DemoPGP-Work-Entity-Item as the directed ancestor.
  6. In the Derives from (Pattern) box, enter or select PGPImp-DemoPGP-Work-Entity-Item as the patterned ancestor.
  7. Click Submit.
  8. In the Stage Name field for the Create stage use the smart-prompt to select the PegaPS-Work.Search stage from the list of available stages.
  9. Override/Save As the PegaPS-Work.Search section as PGPImp-DemoPGP-Work-Entity-Item-Search.Search.
  10. Edit the PGPImp-DemoPGP-Work-Entity-Item-Search.Search section.
  11. Use Structural > Embedded Section to include the section PegaPS-Data.Search in the dynamic layout.
    1. For Page context choose Use clipboard page.
    2. For Class enter PGPImp-DemoPGP-Data-Entity-Item.
    3. For Clipboard page select Item from the list.
    4. For Section choose by name and select Search from the list.
    5. For PARAMETER ShowSearchType set Value to nothing.
    6. Click Submit.
  12. Save the section.
  13. Override/SaveAs the PegaPS-Data.SearchCriteria section as PGPImp-DemoPGP-Data-Entity-Item.SearchCriteria.
    1. Add the key properties for PGPImp-DemoPGP-Data-Entity-Item to this section.
    2. Save the section.
  14. Override/SaveAs the PegaPS-Data.SearchResults section as PGPImp-DemoPGP-Data-Entity-Item.SearchResults.
  15. Edit the PGPImp-DemoPGP-Data-Entity-Item.SearchResults section.
  16. Use Structural > Table to add a table layout to the section and Configure the table.
    1. For Source choose Data page.
    2. For Data page select D_ItemList from the list.
    3. For Parameters check Pass the parameter page.
    4. Submit.
  17. Save the section.

Enabling for App Studio

Socialize the new rules with the dev environment so that they work with, for example, smart-prompting.

  • Use views and design templates to construct the user interface.
  • Manage the new Entity’s rules in Relevant Records so that appropriate choices will appear in the App Studio smart prompts.
  • For appropriate case types set the Show in ‘New’ menu checkbox under Settings -> General to enable the case type to appear on +Create nav.

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