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/22 02:12] – ↷ Links adapted because of a move operation administrator | 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 2: | Line 2: | ||
| ====== Context ====== | ====== Context ====== | ||
| - | When evaluating a rule //**Aware IM**// checks if rule conditions are met and if so executes the action specified by the rule(( | + | When evaluating a rule //**AwareIM**// checks if rule conditions are met and if so executes the action specified by the 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): | 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</ | + | <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. | 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, //**Aware IM**// looks for such instances in the Context (with one exception that we will consider later). The Context can be regarded as a special place within //**Aware IM**// where it keeps “relevant” instances of the business objects and notifications. Still the question is how this Context is formed – how does //**Aware IM**// know which instances are relevant and which ones are not? | + | 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, //**AwareIM**// looks for such instances in the Context (with one exception that we will consider later). The Context can be regarded as a special place within //**AwareIM**// where it keeps “relevant” instances of the business objects and notifications. Still the question is how this Context is formed – how does //**AwareIM**// know which instances are relevant and which ones are not? |
| - | There are certain formal events within //**Aware IM**// that affect the contents of the Context. The full list of such events is described in the [[2000_concepts: | + | There are certain formal events within //**AwareIM**// that affect the contents of the Context. The full list of such events is described in the [[2000_concepts: |
| - | * If an instance of a business object is created by the '' | + | * 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. | * 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: | 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> | <code aim> | ||
| - | CREATE Policy</ | + | CREATE Policy </ |
| We assume here that the '' | We assume here that the '' | ||