| Both sides previous revision Previous revision | |
| 2000_concepts:0800_data_processing:0100_rule_evaluation:0100_context [2026/08/13 00:53] – ↷ Page moved from docs:2000_concepts:0800_data_processing:0100_rule_evaluation:0100_context to 2000_concepts:0800_data_processing:0100_rule_evaluation:0100_context localdev | 2000_concepts:0800_data_processing:0100_rule_evaluation:0100_context [2026/08/13 00:53] (current) – ↷ Links adapted because of a move operation localdev |
|---|
| ====== Context ====== | ====== Context ====== |
| |
| When evaluating a rule //**AwareIM**// checks if rule conditions are met and if so executes the action specified by the rule(( Strictly speaking this is not necessarily true. For un-ordered rule collections an action is not executed immediately but is placed on the agenda first. An action on the agenda may or may not be executed – see [[docs:2000_concepts:0800_data_processing:0100_rule_evaluation:0700_evaluation_unorder_rule_collections|Evaluation of Unordered Rule Collections]]. In this section, however, we will assume for simplicity that actions are always executed )). | When evaluating a rule //**AwareIM**// checks if rule conditions are met and if so executes the action specified by the rule(( Strictly speaking this is not necessarily true. For un-ordered rule collections an action is not executed immediately but is placed on the agenda first. An action on the agenda may or may not be executed – see [[2000_concepts:0800_data_processing:0100_rule_evaluation:0700_evaluation_unorder_rule_collections|Evaluation of Unordered Rule Collections]]. In this section, however, we will assume for simplicity that actions are always executed )). |
| |
| 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): |
| 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? | 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 //**AwareIM**// that affect the contents of the Context. The full list of such events is described in the [[docs:2000_concepts:0800_data_processing|Data Processing]] section. Here we only mention two of them: | 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:0800_data_processing|Data Processing]] section. Here we only mention two of them: |
| |
| * If an instance of a business object is created by the ''[[ref:a_f:a:enter_new|ENTER NEW]]'' or ''[[ref:a_f:a:create|CREATE]]'' actions, it is placed in the Context. | * If an instance of a business object is created by the ''[[ref:a_f:a:enter_new|ENTER NEW]]'' or ''[[ref:a_f:a:create|CREATE]]'' actions, it is placed in the Context. |
| We assume here that the ''Driver'' and the ''Policy'' business objects are defined and that the ''Policy'' business object has our rule attached to it as well as other rules that calculate all the details of the policy. The first action displays the form of the ''Driver'' business object on the user’s screen. As soon as the user enters all the details the instance of the ''Driver'' object is created and is placed in the Context (if there are any rules attached to the ''Driver'' object they are evaluated as well). Then the instance of the ''Policy'' object is created and placed in the Context and the rules attached to the ''Policy'' business object (including our rule) are evaluated. Therefore when our rule is being evaluated the appropriate instances of the ''Driver'' and ''Policy'' business objects will have been already made available in the Context and the system uses the values of the attributes of these objects to check the rule conditions and execute actions. By the time the system finishes the creation of the ''Policy'' object all the details of the policy will have been calculated! | We assume here that the ''Driver'' and the ''Policy'' business objects are defined and that the ''Policy'' business object has our rule attached to it as well as other rules that calculate all the details of the policy. The first action displays the form of the ''Driver'' business object on the user’s screen. As soon as the user enters all the details the instance of the ''Driver'' object is created and is placed in the Context (if there are any rules attached to the ''Driver'' object they are evaluated as well). Then the instance of the ''Policy'' object is created and placed in the Context and the rules attached to the ''Policy'' business object (including our rule) are evaluated. Therefore when our rule is being evaluated the appropriate instances of the ''Driver'' and ''Policy'' business objects will have been already made available in the Context and the system uses the values of the attributes of these objects to check the rule conditions and execute actions. By the time the system finishes the creation of the ''Policy'' object all the details of the policy will have been calculated! |
| |
| More detailed information about the Context is given in the [[docs:2000_concepts:0800_data_processing:0100_rule_evaluation:0800_context_rule_execution|Context of Rule Execution]] section. | More detailed information about the Context is given in the [[2000_concepts:0800_data_processing:0100_rule_evaluation:0800_context_rule_execution|Context of Rule Execution]] section. |
| |
| |