Rules and Rule Types
A Rule is the basic building block of a Pega Platform™ application that defines its behavior. Each Rule is an instance of a Rule Type. The Rule Type determines the type of behavior modeled by the Rule.
When you play a game of chess, you and your opponent agree to follow a specific set of instructions. These instructions govern gameplay, such as how each piece moves on the game board. For example, on its first move, the pawn can move one or two spaces forward. These basic instructions are the rules of chess.
When you model a Case Type in a Pega Platform application, you configure the application with instructions to create, process, and resolve a Case. These instructions are Rules. Rules describe the behavior for individual Cases, such as how the user interface is displayed and when work Urgency increases. Pega Platform uses the Rules you create to generate application code in the background.
Pega Platform provides many Rule types to use as templates for creating a Rule. Each Rule Type models a specific type of behavior, such as automated Decisions or UI design. For example, you use a specific type of Rule called a Flow Rule to model a Process.
Note: To learn more about Rules in Pega Platform, see Rules management.
Automated Rule creation in App Studio
Much of the work of designing an application can be completed by using App Studio. Pega Platform provides a simplified interface that automatically creates and manages the underlying Rules while allowing developers to focus on business tasks. For example, when you configure a Case Type in App Studio, you use the Case Life Cycle and Configuration panels to add Processes, define Steps, and configure Views. In the background, Pega Platform creates and manages the Rules that define the Process flows, Tasks, and UI.
In the center of the following image, slide the vertical line to see the Case Life Cycle with a Process created in App Studio and the Flow Rule of the Process that is created in the background:
Application modularity with Rules
The use of individual Rules makes your application modular. By describing Case behavior with modular, Task-focused Rules, you can combine and reuse Rules as needed. For example, you create a Rule to describe the content of a customer email regarding the status of a change of address. By creating the email message as a separate Rule, rather than embedding the message in the Case Life Cycle, you can update the content of the email without impacting the rest of the business process.
This modularity provides three significant benefits: versioning, delegation, and reuse.
Versioning | Developers create a new version of a Rule whenever Case behavior needs to change. Pega Platform maintains a history of changes to a Rule, allowing developers to review the change history and undo changes if needed. Because each Rule describes a specific Case behavior, the rest of the Case remains unaffected. | For example, a developer updates a UI form with instructions and removes a critical field. You can review the history of the form and revert to the version before the changes were made without changing other Rules in the application. |
---|---|---|
Delegation | Developers delegate Rules to business users to allow business users to update Case behavior as business conditions change. The business user updates the delegated Rule, while other parts of the application remain unchanged. | For example, expense reports that total USD25 or less receive automatic approval. You create a Rule to test whether an expense report totals USD25 or less and delegate the Rule to the Accounting department. The Accounting department can then update the Rule to increase the threshold for automatic approval increases to USD50 without submitting a change request for the application. |
Reuse | Developers reuse Rules whenever an application needs to incorporate existing Case behavior. Otherwise, you must reconfigure the behavior every time you need the behavior. | For example, you create a UI form to collect policyholder information for auto insurance claims. You can then reuse this UI form for property insurance claims and marine insurance claims. |
Note: To learn how to delegate a Rule, see Delegating a Rule or data type. To increase the reusability of a Rule, use parametrization to drive the Rule's logic based on the value passed as a parameter instead of hard-coded data. Parametrization helps to reduce the duplication of code and implementation time of Rule specializations. To learn more about parametrization, see Defining the input parameters of a Rule.
Check your knowledge with the following interaction:
This Topic is available in the following Module:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?