Skip to main content

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

Example: Investment security integration

Updated on January 18, 2022

An investment security contains information related to a security, for example, a company stock. A security has properties such as security name, issue date, and the exchange on which it is traded.

This section describes interaction between PegaFS-Data-InvestmentSecurity data class and corresponding integration class PegaFS-Int-FSF_SAMPLE_SECURITY and underlying sample table FSF_SAMPLE_SECURITY.

At the Data Layer, the PegaFS-Data-InvestmentSecurity class has been defined to be used by the application to store, retrieve, and manage investment securities.

The InvestmentSecurity class contains the properties you would expect when modeling a security. It also defines activities for performing the standard Create, Read, Update and Delete (CRUD) operations on the objects through activities.

Standardized data pages exist that allow for easy access to lists of InvestmentSecurities as well as individual InvestmentSecurity information. Data pages enable developers to easily load, cache, and refresh data. Sections and controls have been updated to accept data pages directly, making it easier to display data.

The consumer of this class is unaware of the details of how these properties are mapped to backend systems. If the application developer builds an application using the properties and activities defined in this class, some or all the backend data mappings can change without impact.

The details about how an InvestmentSecurity is mapped to the underlying data storage are contained in the PegaFS-Int-FSF_SAMPLE_SECURITY class. The left graphic below shows the PegaFS-Data-InvestmentSecurity class and the right graphic shows the corresponding FSF_SAMPLE_SECURITY database table as currently shipped with Pega Foundation for Financial Services 8.6. Note: Sample tables are optionally installed.

The property names defined in the integration class mirror the names of the associated database columns and the class name is like the name of the database. This is not strictly necessary, but it is done for the sake of convenience and clarity. Developers, dealing with the database portion of the interface, typically prefer to use consistent names while developing; it can make debugging easier if the names match.

In an actual implementation, data for the properties defined in the InvestmentSecurity class could be stored in more than one data store in the backend system. The default implementations provided with PFFS are pretty much one-to-one with the database for the sake of simplicity. The tables are prefixed with FSF_SAMPLE_ to indicate that they contain sample data and are meant to be replaced.

Mapping the data:

Data needs to be mapped between the PegaFS-Data-InvestmentSecurity (Data) class and the PegaFS-Int-FSF_SAMPLE_SECURITY (Integration) class. Three Data Transform rules are defined in PegaFS-Int-FSF_SAMPLE_SECURITY to manage these mappings:

  • pyDefault – This data transform simply initializes FSF_SAMPLE_SECURITY page with default values, usually empty values.
  • OpenMap – Data transform called to map data from an integration class page (FSF_SAMPLE_SECURITY) to a data class page (InvestmentSecurity). This is typically done after data has been loaded from the database into an integration page. The mappings are straightforward but can contain logic to handle situations such as derived values or the mapping of constant values between the database and the application.
  • SaveMap – Data transform that maps data in the opposite direction from OpenMap, from a data class page to an integration class page. It is usually called right before data is to be written back to the database, and it could contain logic like that described above for OpenMap.
CRUD operations

Activities need to be implemented to handle the transfer of data to and from the database. The activities in the Data layer call these operations with the data transforms described above to move the data between the Data and Integration layers as well as in and out of the database. Activities defined in PegaFS-Int-FSF_SAMPLE_SECURITY are used to accomplish the data transfer.

Also, a generic activity for CRUD has been created and can be used by implementer:

Class: @baseclass

Activity: PerformCRUD

Data pages:

Every data class in PFFS carries at least 2 standardized data pages that return:

  • List of records: D_InvestmentSecuritySummary calls report definition in PegaFS-Int-FSF_SAMPLE_SECURITY.

  • Lookup a record: D_InvestmentSecurityOpen retrieve a single record as a Page based on primary key(s) from PegaFS-Int-FSF_SAMPLE_SECURITY

  • Previous topic Integration layer (PegaFS-Int-)
  • Next topic Step 7: Defining the security model and organization structure

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. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us