Enterprise Class Structure in Pega
Type: Application Structure
Introduction
- Pega is an enterprise software.
- Designing enterprise class structure is the basic to begin before creating an application.
In simple words, we are going to map our class structure with the client organization.
Here you can see five enterprise class structure layers connected via Inheritance.
- Organisation Layer
- Division Layer
- Unit Layer
- Framework Layer
- Implementation Layer
Org, Div, Unit layer are connected via Pattern inheritance.
Implementation inherits from Framework via Direct Inheritance.
What are the Inheritance types?
Pega supports two Inheritance types.
- Pattern Inheritance
- Direct Inheritance
Let’s see an example first,
You are in a Pega application using a case – Purchase request case.
Implementation class – Amazon-IN-OnlineSales-Work-PurchaseRequest.
Framework class – Amazon–FW-OnlineSalesFW-Work-PurchaseRequest.
Purchase request case contains a sub-process ‘CustomerSearch’ flow.
When the primary case creation flow advances to sub-process, pega use rule resolution algorithm to find the ‘Customer search’ flow.
1. Pattern Inheritance
Pega uses pattern inheritance to check the flow rule available in the class path.
- It means, first it checks ‘Amazon-IN-OnlineSales-Work-PurchaseRequest’.
- If rule is not found, then pega checks ‘Amazon-IN-OnlineSales-Work’ class.
- If it is not found again, then it checks ‘Amazon-IN-OnlineSales-’, checking process continues till ‘Amazon’.
2. Direct Inheritance
You can specify a direct inheritance class in the class rule form.
Class ‘Amazon-IN-OnlineSales-Work-PurchaseRequest’ can directly inherit from framework class ‘Amazon–FW-OnlineSalesFW-Work-PurchaseRequest’.
You can find the pattern inheritance directly from the application class path, while for direct inheritance you need to check the class rule form – general tab.
You can also specify whether pattern inheritance is applicable or not.
- If ‘Find by name first’ pattern inheritance is checked, then pega checks for pattern inheritance first.
- If rule is not found, then the rule resolution algorithm checks the class specified in direct inheritance class field.
- It goes on till @baseclass. All class inheritance ends in @baseclass.
Now let us discuss the Enterprise Class Structure.
We will proceed with Amazon organization example.
Amazon extends its organization in 2 divisions: United States and India. Each division has 2 separate departments – Sales and Service.
Amazon wants the development team to create an application for sales & service department in US division.
If the application is successful, then they may want to extend it to other departments and divisions.
Step 1: Map the organization structure:
Organization – Amazon
Division – US
Unit – Sales
Step 2: Create a new framework application. – CRMFW.
We discussed about framework application in ‘Framework vs. Implementation post.
Click on the application menu and create a new application.
We will see more of the application creation in a separate lesson.
Configure the advanced settings.
After creation, open the application. On header, Application menu -> Open Application
Open the Framework application and check the rulesets.
- CRMFW, CRMFWInt –Framework and its Int ruleset
- Amazon, AmazonInt – Organization and its Int ruleset
Step 3: Create a new Implementation application for Sales department.
Application menu -> New Application
Build-over application is CRMFW framework
Configure the advanced settings.
If you see below, we don’t use ‘Generate reusable division records‘. So our implementation class structure will be Amazon-USSales-Work
In our scenario, we need to reuse division layer, since we are creating applications for different departments for each division. US – Sales + Service.
So, our class structure will be – Amazon-US-USSales-Work
Open the Implementation application and check the rulesets.
- USSales, USSalesInt – Implementation and its Int ruleset
- AmazonUS, AmazonUSInt – Division and its Int ruleset
- Amazon, AmazonInt – Organization and its Int ruleset
Step 4: Now let us create another Implementation application for US division – service department.
Complete the advanced settings. Make the division as reusable layer. So our Implementation class will be Amazon-US-USService-Work
Open the application and check the built-on application and ruleset list.
- USService, USServiceInt – Implementation and its Int ruleset
- AmazonUS, AmazonUSInt – Division and its Int ruleset
- Amazon, AmazonInt – Organization and its Int ruleset
From step 2, 3 & 4, you have created a framework application and two implementation applications.
After checking the rulesets, what do you infer?
1. First let’s go with framework application
- Both the implementation application are built over framework. So all the framework application rulesets are visible to both implementation rulesets.
- It means what are the rules in framework application that can be accessed by implementation application.
- Organization rulesets are added in the framework application – It means that rules in the organization rulesets can be accessed by any implementation application in that organization.
This is the reason why organization specific Integrations are included in organization layer.
2. Implementation applications
- Both the implementation applications share the common organization and division rulesets.
- Since both the implementation Sales & Service are over US division, they share the common division rulesets.
Now, let us look at map the Implementation application with the enterprise class structure.
Each Enterprise layer can contain sub layers. There are three common sub layers:
- Data
- Int
- Work
Organization Layer:
- This layer is the top most layer.
- We can include many divisional layer for a particular organization layer.
Ex: Amazon-US, Amazon-IN can be the two divisional layer which inherits from Amazon – Organizational layer.
- Specify the organization’s specific rules in this layer, so that when a new division comes in, it will inherit from organization and the rules can be re-used.
Ex: Company logo specific UI rules – You can specify the UI rule in organizational layer.
- Organization layer contains two sub layers – Data, Int.
Follows Pattern Inheritance.
Division Layer:
- This layer inherits the organizational layer.
- Each organization can contain multiple divisions and each division can contain multiple departments/units.
Ex: Here, Amazon-US & Amazon-IND are the two divisions.
- Specify the US division specific rules in Amazon-US- layer, so that the above implementation application can inherit from division layer.
Ex: Amazon-US-USSales-Work & Amazon-US-USService-Work are the two implementations that can inherit the common rules from Amazon-US- path.
- Division layer contains two sub layers – Data, Int.
Follows Pattern Inheritance.
Unit layer:
- This layer inherits from division layer.
This is not applicable in our example, since we re-used till the division layer.
You can try the same by re-using unit records.
Then your implementation class will be like,
Amazon-US-Sales-USSales-Work
You can specify the Unit specific rules in Amazon-US-Sales- class so that implementation can re-use those rules in the inheritance path.
Framework Layer:
- This is the framework part of the application which can be extended to any application.
You can create as many applications implementing on different divisions or unit, using built-on application as framework application.
Amazon-FW-CRMFW-Work
- If you see the framework class, you can understand like this inherits from only the generic organization layer (Amazon-).
- You can bring all the common rules, common to implementation application to this framework layer.
Now you may get a question, “Why cant I reuse the organization layer as a framework layer?“
You can see the answer in this picture.
Yes, framework layer can include three sub layers – Data, Int, Work.
- All the process specific common rules can brought under work sub layer.
Amazon-FW-CRMFW-Work
- Create the common rules which can be reused across different applications.
Ex: Customer data type, Customer search UI can be included in framework application. Since this may not change for different departments or divisions.
Implementation layer:
- This layer contains all the implementation specific rules.
- Implementation layer inherits from framework layer.
Type of inheritance is direct inheritance. You can specify the Class in the class rule form.
So Implementation class can use the rules specified in the framework class by inheritance path.
Bring all the rules which are specific to the particular implementation to this layer.
Implementation class cannot be inherited by other class layers.
Try creating various applications and check the ruleset list and class structure created for the same
Hope you get the basics about Enterprise class structure
Please read it more than once to understand clearly
Feel free to drop comments below