Skip to main content
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

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.

Note: Dev Studio uses the term records to refer to rules, properties, and other objects in Pega Platform. You can access rules from the Dev Studio navigation menu by clicking Records and selecting a rule type to display a list of rules of that rule type. To learn more about rules in Dev Studio, see the article Exploring rules in your application.

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:

  1. The internal name for the rule type
  2. The applies to class for the rule
  3. The identifier of the rule
  4. 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.

Note: Some rule types extend the instance key with additional elements. For example, correspondence rules include the correspondence type as part of the instance key. The correspondence type differentiates a correspondence rule to generate an email from a correspondence rule or to generate a text message, even if the two rules share a name and class. 

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.

  • Identifier
  • Class
  • Ruleset
Tip: When creating a rule from a rule reference, the label is determined from the rule name in the referencing field. Consider adding spaces to the label to make the rule description easier to understand.

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.


If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice