Skip to main content

Creating a circumstance template

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 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.

For example, in an application to review loan requests, you can define a circumstance template with properties that hold a loan amount, a customer income, and an account type that the customer has. At run time, the application starts relevant processing when the values of the properties meet specified conditions.

Creating a circumstance template is a first step in circumstancing a rule. As the template holds only properties, you also need conditions to evaluate against the values of the properties.

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

  2. On the Circumstance Template Record Configuration form, enter values in the fields to define the context of the template:

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

    2. Optional:

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

    3. In the Context section, select the application to store the template.

    4. In the Apply to field, press the Down arrow key and select the class that defines the scope of the circumstance template.

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

    6. Optional:

      To override the default work item that your application associates with this development change, in the Work item to associate field, press the Down arrow key, and then select a work item.

      For more information about your default work item, see Setting your current work item.

  3. Click Create and open.

  4. On the Template tab, in the Property field, press the Down arrow key, and then select the name of a property that you want to evaluate at run time.

    For example: Select LoanAmount.
  5. In the Label field, enter the name that corresponds with the property in a circumstance definition.

    When you create a circumstance definition, which has a table layout, each row header displays a property label.

  6. Optional:

    To add more properties, click Add a row, and then repeat steps 4 through 5.

  7. Click Save.

Note: Create a circumstance definition that stores conditions to evaluate against the circumstance template. For more information, see Creating a circumstance definition.

  • Circumstance templates

    Use a circumstance template rule to identify properties for multivariate circumstanced rules. A circumstance template rule contains an array of properties such as .State, .Channel, and .ClaimAmount that reference property values in one or more circumstance definition rules. These rules define the value combinations for each of the properties defined in the circumstance template rule.

  • Changing the scope of rules

    Adjust your application to your specific business needs by changing scope of rules. For example, you can move a rule to another ruleset or class, so that you can reuse the rule in a different part of your application.

  • Setting rule status and availability

    Set rule status and availability to elaborate on the usage information that you provide, and ensure that users interact with the correct version of your rule at run time. By setting rule status and availability, you also define application behavior during rule resolution, and how users can interact with rules at design time. As a result, you ensure that your application works correctly even if users apply extensions and make modifications.

  • Creating a rule

    To save time and ensure that your projects adhere to the unique needs of your clients, create rules and data instances using reusable elements of your application. By combining a rule type, name, class, and ruleset, you provide a unique identity for each rule that you create.

  • Building logic and calculating values in your application

    Provide automations for calculating values and implementing logic so that your application can flexibly respond to unique conditions at run time. For example, you can create a process of transforming data, and, as a result, present users with relevant information when they perform work.

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

Did you find this content helpful?

100% found this content useful

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