Creating a rule specialized by circumstance
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.
In the navigation pane of Dev Studio, click Records.
Expand the category that you want to open, and then open the subcategory that holds the rule that you want to circumstance.Expand Process, and then click Flow.
In the list of instances, click the rule that you want to open.
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.
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.
Define circumstance conditions:
Choices Actions Circumstance the rule by a set of conditions
In the CIRCUMSTANCE BY section, select Template.
In the Template field, enter the template that stores properties to evaluate.
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
In the CIRCUMSTANCE BY section, select Property and Date.
In the Property field, enter a property to evaluate at run time.Enter LoanAmount.
In the Value field, enter a value to evaluate against the property.Enter 5000.
Circumstance the rule by date
In specific business scenarios, you can also circumstance rules by a combination of property and date.
In the CIRCUMSTANCE BY section, select Property and Date.
In the Date property field, enter a property that stores a date to evaluate at run time.
To specify an exact starting time when an application can resolve the rule, in the Start Date field, select the date.
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.
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.
Update the values in the Context and Add to ruleset lists as appropriate.
Click Create and open.
- 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.