LinkedIn
Copied!

Table of Contents

Creating a circumstance definition

Version:

Only available versions of this content are shown in the dropdown

You can create a circumstance definition to evaluate properties in a circumstance template.

  • Check whether at least one circumstance template is defined in your application.
  • Make sure that the PegaRULES database supports access by developers to create circumstance definitions. For more information, see Database Name form — Completing the Database tab.

  • Ensure that your changes do not exceed column thresholds. See the Pega Community article Troubleshooting: "Exceeds the maximum number of columns" when creating a Circumstance Definition rule.

  1. In the header of Dev Studio, click Create Technical Circumstance Definition .

  2. On the Create Circumstance Definition form, enter values in the fields to define the context of the flow.

    1. In the Label field, enter text that describes the purpose of the circumstance definition.

    2. Optional:

      To change the default identifier for the circumstance definition, click Edit, and then provide a unique value in the Identifier field.

    3. In the Template Name field, press the Down Arrow key, and then select the circumstance template that your circumstance definition implements.

    4. Select the Context.

    5. In the Apply to field, press the Down Arrow key and select the class that defines the scope of the circumstance definition.

    6. In the Add to ruleset field, select the name and version of a ruleset that stores the circumstance definition.

  3. Click Create and open.

  4. On the Definition tab, add conditions to the Apply this definition table that evaluate the properties from the circumstance template.

    1. Click each column heading to choose which operations it supports.

      To reset the operations for a column, clear the Use Range check box, and then select = from the Use Operator list.
      • For columns that require a single operation, select an operator from the Use Operator list.

      • For columns that require a range, select the Use Range check box, and then choose operators from the Starting Range and End Range lists.

    2. Click the Insert Row After icon.

    3. For each column in the row, enter a property or an expression that evaluates properties.

    4. Drag rows to change the order in which your application evaluates them at run time.As a best practice, list the more likely outcomes in rows at the top of the table.

  5. Click Show conflicts to test the completeness or consistency of your conditions.

  6. Click Save.

  • Circumstance rule examples

    Assume that you have different pricing levels for your customers. You first define a base pricing rule for all customers. Then you qualify the base rule by creating circumstanced rules for customers at different buying levels. The property .CustomerType is part of the customer order and has values of "Silver" and "Gold". In this example, a customer has purchased a $100 item. Using the property and values, you create circumstanced instances of the base rules as shown here:

  • Circumstance definitions

    A circumstance is an optional qualification available for supported rule types and is built upon the base rule.

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.