SysAdmin Category in PEGA
Tags: pega, java, bpm, automation
Published: 2020-07-18 13:17:21

Hey guys...! Hope you are now familiar with Activities, Data Transform, Portal, Harness, flow e.t.c., Incase if you are new to Pega, I highly recommend you check out my previous posts on Handling data and User Interface in PEGA(Links are provided in the footer). So Today I would like to explain to you about SysAdmin Category in PEGA.

SysAdmin Rules you should be familiar with are as follows:
1. Class
2. Declare Index
3. Agent
4. Ruleset

Let's get to them in detail-
##**1. Class:**
Class is an instance of the Rule-Obj-Class rule type.
There are three types of classes in PEGA:

a. **Work class** contains the rules that describe how to process a case or cases, such as processes, data elements, and user interfaces.

b. **Integration class** contains the rules that describe how the application interacts with other systems, such as a customer database or a third-party web server.

c. **Data class** contains the rules that describe the data objects used in the application, such as a customer or collection of order items.

A class can also contain other classes. A class that contains another class is called a *Parent class*, while a class that is contained by another class is called a *Child class*. A Child class can reuse, or inherit any rule defined in its parent class.

The classes that comprise an application are called as a class hierarchy. The class hierarchy determines how system architects can reuse rules within the application. The ultimate base class is named as **@baseclass**.

**Inheritance**
There are two methods for inheriting rules:
a. Pattern inheritance
b. Direct inheritance

**Pattern inheritance** is automatic. It uses the class name structure to determine the rules available to reuse. Pega Platform uses a multi-level class hierarchy of Organization (Org), Division (Div), Unit, and Class group to organize an application.

The _organization layer_ contains all the classes for applications across an entire business or other organization. The organization layer often contains data and integration classes that can be applied across the entire organization.

The _division layer_ contains the work, data, and integration classes for the division.

The _unit layer_ contains the work, data, and integration classes for the unit.

The _class group_ contains all the case types in an application.

**Directed inheritance** is inheritance between classes where the parent class is explicitly specified. You apply directed inheritance to reuse standard Pega Platform rules and rules from other applications outside the business class hierarchy. Unlike the automatic use of pattern inheritance, directed inheritance is explicit. You list directed inheritance on the class rule form.

_Inheritance allows your application to reuse existing rules for other cases or applications. Rule reuse reduces development and testing time without sacrificing application quality._

##**2. Declare Index:**

_Declare Index_ rules are instances of the Rule-Declare-Index class.
We can consider Declare index as an index in a book that points out to particular page of a topic. Similarly in Pega Declare index rule points to data present in DB.

Indexing can improve database performance and facilitate reporting. Create a Declare Index rule to define criteria under which the Pega automatically maintains index instances for faster access. An index can improve search and reporting access for properties that cannot be exposed as database columns because they are embedded within an aggregate property.

We use BLOB to store Aggregate values.

*BLOB:*
It is a Binary Large Object. Collection of binary data stored under a single column. It is an efficient and flexible mechanism used by PRPC to compress the data. It can contain any amount of information comprising of simple single value properties to a page list.*

Index tables can be used to store the data that are embedded in aggregate properties. We can directly refer to that index table, instead of decompressing the blob and checking the details inside the blob. It helps in creating an index for the properties embedded in aggregate properties.

##**3. Agent:**

Every Application requires to perform some task without any human intervention. That's where Agent is used in PEGA.

_Agent_ is an internal background process operating on the server that runs activities on a periodic basis. Agents route work according to the rules in your application; they also perform system tasks such as sending email notifications about assignments and outgoing correspondence, generating updated indexes for the full-text search feature, and so on. Each Ruleset can Contain only one Agent rule.

Agents are autonomous and asynchronous: the activities they call run individually on their own schedules, and a second activity execution can start before the completion of an earlier one.

Agents are defined by Agent rules (Rule-Agent-Queue rule type). Agents are enabled and scheduled through Agent Queue data instances (Data-Agent-Queue class). 

##**4. Ruleset:**

A _Ruleset_ identifies, stores, and manages the set of rules that define an application or a major portion of an application. You can share a ruleset between applications to allow several applications to use the same rules. The ability to re-use already-built rules saves development time and effort.

Individual rules are collected into an instance of a ruleset, called a _Ruleset version_. To update the contents of the ruleset, you create a new ruleset version. Ruleset versioning allows us to easily update applications by providing access to an entire set of rules at once. The version number is divided into three segments: a major version, a minor version, and a patch version.

**Major version** change encompasses extensive changes to application functionality. 

**Minor version** represents an interim release or enhancements to a major release. 

**Patch version** consists of fixes to address bugs in an application.

*A better understanding of Class hierarchy and rulesets is highly necessary for every developer.*

Here are some topics one must know as a Pega Developer.
**BONUS:**

**Clipboard:**

During case processing, each page remains in memory in a structure known as the clipboard. The clipboard is the portion of memory on the server reserved by Pega for the data generated by applications. The clipboard consists of all of the pages used to track the name-value pairs that represent case and session data. The clipboard receives its name because pages can be added to or removed from memory as needed to track case or session data. So, when a value is assigned to a data element, the data element and its value are said to be on the clipboard.

As you run a process, Pega sends information to the clipboard, adding or removing pages and properties from memory. Your application uses this information to populate fields on UI forms, perform calculations, and evaluate decisions. You can also use Pega for testing and debugging purposes.

**pyworkpage:**

When you debug case behavior, you often need to view the case data that is in memory on the clipboard. Viewing the data on the clipboard can help you identify the cause of the issue. For example, if a data transform returns an unexpected result, you can review the contents of the clipboard to determine if one of the input properties has been set with unexpected value.

*pyWorkPage* stores all the data generated while creating and processing a case. pyWorkPage is a specific page on the clipboard. For example, pyWorkPage stores data such as the case creation date or the case ID. An embedded page with pyWorkPage stores data that describes a data type. For example, if a case uses a data type named Customer, then Customer is an embedded page within pyWorkPage. Pega Platform writes all the properties that describe the Customer data type — such as the first name — to the embedded page.

When you open a child case, the clipboard also contains the page pyWorkCover. **pyWorkCover** contains the case data for the parent case. This enables you to copy data between the parent case and the child case.

                   *         *           *

These are huge topics so it's difficult to explain everything about these topics. I highly recommend you to check about them at [PDN](https://community.pega.com/)

*Note: All my posts are for just giving you a basic idea about these topics in PEGA.*

I hope it's helping you. Let me know your thoughts in the comments. 
Also, Check out my posts on other topics of PEGA:
[Start your journey with PEGA](https://dev.to/mahithchigurupati/start-your-journey-with-pega-5053)
[Handling Data in PEGA](https://dev.to/mahithchigurupati/moving-forward-into-pega-48n7)
[User Interface in PEGA](https://dev.to/mahithchigurupati/user-interface-in-pega-351m)

Thank you, guys.