Monday, 21 May 2018

Pass/Propagate data from a parent case to child case

Sometime in a case management application where we have one or more subcases for a case, we may need to use some data from a parent case in a child case. e.g. In a 'Request Purchase' case we have one Purchase Order subcase where in the subcase we may need OrderId or PurchaseId from the case. This is called 'Data Propagation'. 
To propagate the data from a case to subcase we need to configure the data propagation on the parent case. The data propagation configuration is available on Details tab of a parent case. Click edit to configure data propagation.
Here we have two options to map the data:-
a. Directly map properties of parent case to the properties of child case
b. Use a data transform

Normally we map the properties but if you need some conditional mapping or more advanced data propagation then you go with data transform. 

Important:- Data Propagation only happens once i.e. when cases are initially created. If you propagate a property from the Parent case to a child case, and the property value later changes on the Parent Case, the property on the child case does not get updated.

Get data from external data sources for pega application

Normally we store data in our application from tables using data pages and access these data in UI using sections. In this post I will explain how to reference external source data in our application. 
There are two ways to do this:-
1. Database Table Class Mapping Tool
2. SQL Connector

The Database Table Class Mapping tool is a inbuilt wizard in pega PRPC which generates all the artifacts needed to reference data in an external database. These artifacts include a data class, a database table instance and a link between those two artifacts.

The SQL connector is advance tool in pega PRPC which is used when you want to write your custom and complex SQL queries to interact with database tables. 

So to summarize, Database Table Class Mapping Tool is very simple method to do this. Before starting this wizard you need to configure the external database in your application. Then decide which table from configured database you want to use.