Precedents Identified Directly by CER

The utility directly identifies these types of dependencies for a calculated attribute value:

Table 1. Precedents Identified Directly by CER
Name When Identified Trigger for Recalculation
Stored Attribute Value

Identifies any "input" attribute value stored on CER's database tables which was retrieved during the overall1calculation of the attribute value.

The precedent ID refers to the internal ID for the stored attribute's database row on CER's database tables.

If the value of the stored attribute changes, then a precedent change item for the stored attribute value will be written to a precedent change set.
Rule Set Definitions

Identifies each rule set containing any of the attributes used within the overall calculation of the attribute value.

The precedent ID refers to the name of the rule set containing one or more attribute definitions encountered during the overall calculation.

If changes to a CER rule set are published, then a precedent change item for the changed rule set will be written to a precedent change set.
'readall' search

Identifies any readall (with no nested match) expressions encountered during the overall calculation, which retrieved rule objects stored on CER's database tables (as opposed to rule objects retrieved using rule object converters - see Precedents Identified by Rule Object Converters instead).

The precedent ID refers to the name of the rule class sought by the readall expression.

A precedent change item for the rule class will be written to a precedent change set if:

  • a new rule object for that rule class is stored on CER's database tables; and/or
  • an existing rule object for that rule class is removed from CER's database tables.
'readall/match' search

Identifies any readall expressions encountered during the overall calculation, which retrieved rule objects stored on CER's database tables (as opposed to rule objects retrieved using rule object converters - see Precedents Identified by Rule Object Converters instead).

The precedent ID refers to the name of the rule class sought by the readall expression, together with the attribute name and value used as the search criterion.

A precedent change item for the rule class and its attribute name and match value will be written to a precedent change set if:

  • a new rule object for that rule class is stored on CER's database tables;
  • an existing rule object for that rule class is removed from CER's database tables; and/or
  • the value of the attribute used in the search criterion changes for an existing rule object (in which case two precedent change items will be written - one for the old value of the attribute and another for the new value of the attribute).
2

These types of dependencies are best illustrated with an example.

Let's say a new system is written which uses CER to calculate a person's tax liability. This Tax Liability system uses the Dependency Manager to store dependencies, so that the tax liability can be recalculated (using CER) if the person's circumstances change.

The Tax Liability system stores system-wide "tax threshold" information in rule objects, with these rule objects stored on CER's database tables. The CER rules for calculating a person's tax liability include a readall expression to retrieve all the tax thresholds in the system.

The Tax Liability system also stores system-wide "asset" information in rule objects, with these rule objects stored on CER's database tables. Each asset specifies its owner and its market value. The CER rules for calculating a person's tax liability include a readall expression to retrieve all assets owned by that person (i.e. those with an Asset.ownedByPersonID matching the Person.personID). It is possible for an asset's market value to change, and/or for an asset to be transferred from one person to another, by changing its Asset.ownedByPersonID from one person's ID to another.

The CER rules for calculating a person's tax liability involve summing the Asset.marketValue of all the assets owned by that person.

The Tax Liability system contains separate CER rule sets for retrieving the input data required for the tax liability calculation vs. the actual business calculations which use that retrieved data to calculate a person's tax liability.

A user uses the Tax Liability system to calculate the tax liability for Joe (personID 456) and for Mary (personID 457), who each have one asset. The Tax Liability system uses the CER utility to identify dependencies, and passes these to the Dependency Manager for storage, resulting in the following dependencies being stored:

Table 2. Dependencies Stored For Tax Liability Example
Dependent Type Dependent ID Precedent Type Precedent ID
Tax Liability 456 (Joe's person ID) 'readall' search Rule class: TaxThreshold3
Tax Liability 456 'readall/match' search Rule class: Asset, with attribute value ownedByPersonID=4564
Tax Liability 456 Stored Attribute Value 789 (the internal ID of Asset.marketValue for Joe's asset)5
Tax Liability 456 Rule Set Definitions TaxLiabilityDataRetrievalRuleSet6
Tax Liability 456 Rule Set Definitions TaxLiabilityBusinessCalculationsRuleSet7
Tax Liability 457 (Mary's person ID) 'readall' search Rule class: TaxThreshold8
Tax Liability 457 'readall/match' search Rule class: Asset, with attribute value ownedByPersonID=4579
Tax Liability 457 Stored Attribute Value 780 (the internal ID of Asset.marketValue for Mary's asset)10
Tax Liability 457 Rule Set Definitions TaxLiabilityDataRetrievalRuleSet11
Tax Liability 457 Rule Set Definitions TaxLiabilityBusinessCalculationsRuleSet12
13141516171819202122

We can now see how recalculations of tax liability will be triggered by various changes in data:

Table 3. Example Precedent Change Items for Tax Liability
Data Change Precedent Change Items Recorded Recalculations Triggered
The market value of Joe's asset increases from $100 to $120
  • Stored Attribute Value, 789
  • Joe's tax liability is recalculated
Mary sells her asset and its rule object is removed
  • 'readall/match' search, Rule class: Asset, with attribute value ownedByPersonID=457
  • Mary's tax liability is recalculated
Joe receives a new asset, stored as a new rule object
  • 'readall/match' search, Rule class: Asset, with attribute value ownedByPersonID=456
  • Joe's tax liability is recalculated
Joe transfers his first asset to Mary, thus the asset's ownedByPersonID changes from 456 to 457
  • 'readall/match' search, Rule class: Asset, with attribute value ownedByPersonID=456 (old value)
  • 'readall/match' search, Rule class: Asset, with attribute value ownedByPersonID=457 (new value)
  • Joe's tax liability is recalculated
  • Mary's tax liability is recalculated
An administrator introduces a new tax threshold, stored as a new rule object
  • 'readall' search, Rule class: TaxThreshold
  • Joe's tax liability is recalculated
  • Mary's tax liability is recalculated
An administrator removes an existing tax threshold, thus removing its rule object
  • 'readall' search, Rule class: TaxThreshold
  • Joe's tax liability is recalculated
  • Mary's tax liability is recalculated
An administrator publishes changes to the TaxLiabilityBusinessCalculationsRuleSet rule set
  • Rule Set Definitions, TaxLiabilityBusinessCalculationsRuleSet
  • Joe's tax liability is recalculated
  • Mary's tax liability is recalculated
1 I.e. the calculation of the attribute itself, or on any of the internal attribute values on which it ultimately depends (the "intermediate" calculations between the calculated attribute value and its external data inputs).
2 I.e. the calculation of the attribute itself, or on any of the internal attribute values on which it ultimately depends (the "intermediate" calculations between the calculated attribute value and its external data inputs).
3 Stored because the calculation of Joe's tax liability caused a retrieval of all TaxThreshold rule objects.
4 Stored because the calculation of Joe's tax liability caused a retrieval of all Asset rule objects owned by Joe.
5 Stored because the calculation of Joe's tax liability accessed the stored value of marketValue on the single asset retrieved for Joe.
6 Stored because the calculation of Joe's tax liability involved the definitions of rule attributes in the TaxLiabilityDataRetrievalRuleSet (used to retrieve the TaxThreshold and Asset rule objects).
7 Stored because the calculation of Joe's tax liability involved the definitions of rule attributes in the TaxLiabilityBusinessCalculationsRuleSet (used to compute the overall tax liability based on input data).
8 Stored because the calculation of Mary's tax liability caused a retrieval of all TaxThreshold rule objects.
9 Stored because the calculation of Mary's tax liability caused a retrieval of all Asset rule objects owned by Mary.
10 Stored because the calculation of Mary's tax liability accessed the stored value of marketValue on the single asset retrieved for Mary.
11 Stored because the calculation of Mary's tax liability involved the definitions of rule attributes in the TaxLiabilityDataRetrievalRuleSet (used to retrieve the TaxThreshold and Asset rule objects).
12 Stored because the calculation of Mary's tax liability involved the definitions of rule attributes in the TaxLiabilityBusinessCalculationsRuleSet (used to compute the overall tax liability based on input data).
13 Stored because the calculation of Joe's tax liability caused a retrieval of all TaxThreshold rule objects.
14 Stored because the calculation of Joe's tax liability caused a retrieval of all Asset rule objects owned by Joe.
15 Stored because the calculation of Joe's tax liability accessed the stored value of marketValue on the single asset retrieved for Joe.
16 Stored because the calculation of Joe's tax liability involved the definitions of rule attributes in the TaxLiabilityDataRetrievalRuleSet (used to retrieve the TaxThreshold and Asset rule objects).
17 Stored because the calculation of Joe's tax liability involved the definitions of rule attributes in the TaxLiabilityBusinessCalculationsRuleSet (used to compute the overall tax liability based on input data).
18 Stored because the calculation of Mary's tax liability caused a retrieval of all TaxThreshold rule objects.
19 Stored because the calculation of Mary's tax liability caused a retrieval of all Asset rule objects owned by Mary.
20 Stored because the calculation of Mary's tax liability accessed the stored value of marketValue on the single asset retrieved for Mary.
21 Stored because the calculation of Mary's tax liability involved the definitions of rule attributes in the TaxLiabilityDataRetrievalRuleSet (used to retrieve the TaxThreshold and Asset rule objects).
22 Stored because the calculation of Mary's tax liability involved the definitions of rule attributes in the TaxLiabilityBusinessCalculationsRuleSet (used to compute the overall tax liability based on input data).