LinkedIn
Copied!

Table of Contents

Creating a circumstance definition

Version:

Only available versions of this content are shown in the dropdown

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.

For example, in a banking application, if your circumstance template includes a LoanAmount property, and the definition includes the value 5000 with an operator >, the application resolves the circumstance rule only when the loan request amount is greater than 5000.
Create a circumstance template that stores properties to evaluate by the circumstance definition. For more information, see Creating a circumstance template.
  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 definition:

    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 in the Identifier field, provide a unique value.

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

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

    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.

    7. 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 Definition tab, click the column header to choose which operations the column supports:

    • For columns that evaluate properties from the template against a single value, select an operator from the Use Operator list, for example >.
    • For columns that evaluate properties from the template against a range of values, select the Use Range check box, and then choose operators from the Starting Range and End Range lists, for example >= and <=.
  5. Click Save.

  6. Click a cell in a table that you want to define, and then enter a value or an expression that evaluates properties in the template.

    To evaluate loan amounts greater than 5000, use a single operator >, and then enter 5000.
  7. Optional:

    To provide more values for evaluation, add rows to the table:

    • To add a row before the current cell, on the toolbar, click Insert Row Before, and then repeat step 6.
    • To add a row after the current cell, on the toolbar, click Insert Row After, and then repeat step 6.
    As your application evaluates the table from top to bottom, to save time and resources, place the most likely outcomes at the top of the table.
  8. Optional:

    To ensure that your application can process the table, check the table for conflicts by clicking Show conflicts on the toolbar.

    A warning icon appears in rows that are unreachable or empty.
  9. Click Save.

At run time, an application evaluates the values from the circumstance definition against the properties in the circumstance template and resolves the rule only when the values evaluate to true.
  • Date circumstance rule

    A date circumstance rule is a circumstance that is only resolved during a specified range of time.

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

  • Date combinations and business requirements

    The following table lists the possible date combinations and the business-logic requirements they meet when you circumstance by date.

Did you find this content helpful?

100% found this useful

Have a question? Get answers now.

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