Skip to main content

Creating a rule specialized by circumstance

Pega Community logo

Note: The following content, referenced from Pega Community, is included here to help you better achieve the module learning objectives.

Create a rule specialized by circumstance to provide a variant of the rule that your application triggers only conditionally under specified conditions. By creating specialized or circumstance rules, you address dynamic business requirements without changing the core logic of your application.

For example, in an application to review loan requests, additional processing can start only when the request amount exceeds a value that you specify. You can also specify a time frame when the rule is active and available for rule resolution. When you circumstance rules instead of applying other solutions, such as decision tables, you create an application that is easier to maintain and edit if you need any adjustments in the future.
Before you begin: If you want to circumstance a rule by using a set of conditions, create a circumstance template and definition. For more information, see Creating a circumstance template and Creating a circumstance definition.
  1. In the navigation pane of Dev Studio, click Records.
  2. Expand the category that you want to open, and then open the subcategory that holds the rule that you want to circumstance. For example: Expand Process, and then click Flow.
  3. In the list of instances, click the rule that you want to open.
  4. In the rule form header, open the new rule form:
    • If the rule is checked out, click the Down arrow next to the Save button, and then click Specialize by circumstance.
    • If the rule is checked in, click the Down arrow next to the Save as button, and then click Specialize by circumstance.
  5. Optional: To provide information about the purpose of the new rule, in the Label field, enter a new short description.
    The identifier remains the same, even if you provide a new label.
  6. Define circumstance conditions:
    Choices Actions
    Circumstance the rule by a set of conditions
    1. In the CIRCUMSTANCE BY section, select Template.
    2. In the Template field, enter the template that stores properties to evaluate.
    3. In the Definition field, enter a definition that references properties from the template.
      At run time, your application resolves the rule if conditions from the definition evaluate to true.
    Circumstance the rule by property
    1. In the CIRCUMSTANCE BY section, select Property and Date.
    2. In the Property field, enter a property to evaluate at run time. For example: Enter LoanAmount.
    3. In the Value field, enter a value to evaluate against the property. For example: Enter 5000.
    Circumstance the rule by date
    1. In the CIRCUMSTANCE BY section, select Property and Date.
    2. In the Date property field, enter a property that stores a date to evaluate at run time.
    3. Optional: To specify an exact starting time when an application can resolve the rule, in the Start Date field, select the date.
    4. Optional: To specify an exact time after which an application omits the rule in rule resolution, in the End Date field, select the date.

      If you leave a date property blank, your application evaluates the specified time period against the current system date.

      If the rule is active during the specified time interval only, then at all other times, the base rule is active. During rule resolution, if two or more date circumstance versions are candidates at the current time and date, the application selects the candidates with the nearest end date. If multiple remaining candidate rules have the same end date, the application picks the candidate with the most recent start date. For more information about possible date combinations and the business-logic requirements that they meet, see Date combinations and business requirements.

    Tip: In specific business scenarios, you can also circumstance rules by a combination of property and date.
  7. Optional: To override the default work item that your application associates with this development change, press the Down arrow key in the Work item to associate field, and then select a work item.
    For more information about your default work item, see Setting your current work item.
  8. Update the values in the Context and Add to ruleset lists as appropriate.
  9. Click Create and open.
Result: At run time, an application resolves the rule when the conditions that you specified evaluate to true. If the conditions evaluate to false, the application resolves the base form of the rule.
  • Creating a circumstance template

    Create a circumstance template to define a set of conditions that your application evaluates at run time to determine whether a rule is available for rule resolution. By creating circumstance templates, you deliver a flexible application that starts relevant processing under specified conditions, without implementing complex and advanced business-logic solutions.

  • Creating a circumstance definition

    Begin relevant processing in your application only under specified conditions by creating a circumstance definition. When you implement circumstancing in your application, you provide flexible solutions without defining complex logic. As a result, you increase efficiency and design an application that is easier to maintain in the future if your business requirements change.

  • Controlling the order of circumstance definitions

    Provide relevant processing in scenarios when multiple conditions evaluate to true, to ensure that users of your application interact with the intended data and application behavior. By defining the priority of circumstance definitions, you determine how your application behaves when more than one definition meets specified conditions.

  • Creating a redirected rule

    To create redirected rules, which are circumstance rules that are configured to reference other circumstance rules for the same base rules, complete the following tasks.

  • Base rules

    A base rule is the fallback rule selected by rule resolution when no other circumstance version's criteria is met. Base rules have no circumstance qualification.

  • Finding rules by circumstance

    To verify if an existing rule is either a base rule or a circumstance, open it in Dev Studio and inspect the form header. Click the Circumstanced link to see circumstance values or an indication that the rule is a base version. The link does not appear if the existing rule is neither a base nor a circumstanced version.

  • Specializing a case type

    Specialize a case type to support variations in the way that cases are processed in your application. Each version that you create is uniquely identified by a circumstance.

  • Rule resolution exceptions

    Understanding rule resolution ranking exceptions can help you troubleshoot unexpected rule resolution results.


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