Rule creation
Rule creation in Dev Studio
If you need more control over how a rule is created and reused, you can create the rule in Dev Studio. When you create a rule in Dev Studio, the New Record form prompts you to provide four pieces of information: rule type, identifier, class, and ruleset. This information is used to identify the rule uniquely within your application. This combination allows an application to call the correct rule during case processing, through a process called rule resolution. With rule resolution, Pega Platform™ determines the appropriate rule to run when an application calls a rule.
In the following image, click the + icons to learn more about the New Record form.
Pega Platform creates an instance key — stored using the property .pzInsKey — to identify each rule on the system uniquely. The instance key generally consists of four elements separated by a space:
- The internal name for the rule type
- The applies to class for the rule
- The identifier of the rule
- The timestamp from when the rule was created, normalized to Greenwich Mean Time (GMT)
For example, you create a service level at 11:31:52 AM on January 20, 2021, by providing the following information on the New Record form.
- Identifier: StandardApproval
- Apply to class: MyOrg-MyApp-Work-CaseType
The .pzInsKey for the rule is RULE-OBJ-SERVICELEVEL MYORG-MYAPP-WORK-CASETYPE STANDARDAPPROVAL #20210120T163152.765 GMT.
Different methods of rule creation in Dev Studio
You can access the New Record form in several ways based on how you create a new rule. The manner of rule creation determines the amount of information that is automatically entered. The following table describes some rule creation methods and identifies the information specified on the New Record form.
Method | Information specified on the New Record form |
---|---|
Create a rule from the Create menu | The rule type, application context, and ruleset are specified by default. |
Create a rule from the App Explorer | The rule type, application context, ruleset, and class are specified by default. |
Create a rule from a rule reference | The rule type, application context, ruleset, and class are specified by default. If the name of the rule is provided in the reference, the label and identifier for the rule are also specified. |
Open an existing rule and click Save As |
The rule type, application context, ruleset, class, label, and identifier are specified by default. However, at least one of the following pieces of information must change, or Pega Platform returns an error when you click Create and open.
|
In the center of the following image, slide the vertical line to compare creating a service-level agreement (SLA) rule from the Create menu and creating an SLA rule from the App Explorer.
Check your knowledge with the following interaction.
Want to help us improve this content?