In this quick tutorial you will learn about How to Designing Reports with Multiple Sources in Pega 8.
Three techniques to create a report that references data from multiple classes:
- Combining data in a report by creating subreports,
- Configuring class joins,
- Referencing reusable association rules.
Data storage in Pega:
- Pega saves data across multiple database tables when a case is processed.
- The system uses Pega classes to organize and store the data in the appropriate table.
- Pega reporting tool uses the Pega class organization to find and retrieve information from these tables.
Class Mappings and Database tables:
- Any Pega class that has instances, such as case types, can be mapped to a database table.
- Reports use class mappings to locate the data from one or more database tables.
- When designing reports, you need to know which table has the data and how the data is mapped.
Note: Pega now uses the term work queue in place of workbasket in assignment routing. The class structure still uses the workbasket name which is Data-Admin-Workbasket
Records used for mapping classes to tables:
Pega uses two records to identify the database table the class is mapped to:
- Database Table
- It identifies how Pega connects to a specific database for the named database.
- Database records can be configured to use either JNDI or JDBC url for the database connection.
- A Database table record identifies a specific table in a specific database, and specifies the corresponding Pega class.
- Pega uses this record to identify which table to write case data when a user creates or updates a case.
Combining classes using joins and associations:
You can relate properties in multiple database tables or classes to combine data in a single report.
- Use case and subcase relationships to show subcase data along with the parent case data.
- Use case and assignment relationships to show how the system processes assignments for a specific case or a subcase. For example, assume you want to show the operators working on specific cases. You match the operator identifier in the case database table with the operator ID column in the assignment table.
- Use case and history relationships to monitor performance. For example, assume you want to show the total amount of time required to resolve specific cases, you match the case identifier in the case data table with the case identifier in the history table.
When you build a class relationship in a report definition, you configure a class join. Follow these basic steps to create a class join.
- Determine the class to which you are joining.
- Create a prefix that in combination with the class name serves as an alias for the joined class.
- Decide whether you want to include or exclude instances that do not match.
- Create a filter that describes how you relate the classes.
You use association rules to join multiple classes. Unlike a class join (unique to each report), associations can be reused in any report.
Managers can also use associations when they create reports in the Case Manager portal.
For example, assume you want to combine records in the Assign-WorkBasket class with records in the work classes. You use the standard WorkBaket Assignment (pxWorkbasketAssignments) association rule to join the classes.
When you add a column, you specify the association rule class name as a prefix, then select the properties in the class.
Click here to see Standard Association Rules
Combining data from different classes using a subreport:
Subreports enable you to reference results from any report definition in a main report.
Note: Consider subreports as a way of combining data using IN, HAVING, and WITH clauses.
Subreports can be defined in classes different from the main report. You can access data in different classes similar to the way you would use a class join or an association.
- You commonly use subreports to satisfy complex reporting requirements. For instance, you can use subreports to filter results. This approach allows you to include or exclude data.
- You can also use subreports to display aggregate calculations on specific rows in a main report.
Two different methods to create a subreport: Join filters or Aggregation