Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| 2000_concepts:0800_data_processing:0100_rule_evaluation:0100_context [2022/08/21 22:47] – removed - external edit (Unknown date) 127.0.0.1 | 2000_concepts:0800_data_processing:0100_rule_evaluation:0100_context [2026/08/13 00:53] (current) – ↷ Links adapted because of a move operation localdev | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | [< | ||
| + | ====== Context ====== | ||
| + | |||
| + | When evaluating a rule // | ||
| + | |||
| + | Let us consider the following rule as an example (taken from an application that manages car insurance policies – the rule itself may or may not be very realistic, but it does not matter for the purposes of this example): | ||
| + | |||
| + | <code aim>IF Driver.Age > 70 Then INCREASE Policy.Excess BY 100 </ | ||
| + | |||
| + | According to this rule the system is supposed to evaluate whether the age of the driver is greater than 70 and if so, increase the excess of the policy by 100 dollars. The question is – which driver and which policy? The system may have details about thousands of drivers and thousands of policies in its database – so, which ones are we talking about? If you ask a businessperson this question, she will probably answer something along the lines of “Of course, I know what I am talking about – the driver here is the person who has asked for a quote and the policy is the policy we are calculating for her”. Judging from this imaginary but quite possible answer, one can draw a conclusion that a businessperson always has a certain context in mind when she talks about business rules. In the example above this context is the fact that someone asked for a quote already - the business rule is therefore evaluated within this context and so “the driver” and “the policy” have a very specific meaning. | ||
| + | |||
| + | The concept of //Context// therefore is the key to rule evaluation and action execution – when deciding which instances of the business objects to consider when checking rule conditions and executing actions, // | ||
| + | |||
| + | There are certain formal events within // | ||
| + | |||
| + | * If an instance of a business object is created by the '' | ||
| + | * If rules attached to a business object are being evaluated the instance of the business object, for which rules are being evaluated, is placed in the Context. | ||
| + | Now let us go back to our rule – to get a full picture of what is going on when it is being evaluated we must consider what was happening before and restore the context of rule evaluation. We assume here that the software calculates the details of the requested policy after someone has asked for a quote. It is therefore quite reasonable to assume that there is some process that displays the form with the driver’s details to be filled out by a user and after the form has been filled out calculates the details of the policy. The rules of the process might look something like this: | ||
| + | |||
| + | <code aim> | ||
| + | CREATE Policy </ | ||
| + | |||
| + | We assume here that the '' | ||
| + | |||
| + | More detailed information about the Context is given in the [[2000_concepts: | ||
| + | |||