The utility directly identifies these types of dependencies for a calculated attribute value:
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:
|
'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:
|
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:
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:
Data Change | Precedent Change Items Recorded | Recalculations Triggered |
---|---|---|
The market value of Joe's asset increases from $100 to $120 |
|
|
Mary sells her asset and its rule object is removed |
|
|
Joe receives a new asset, stored as a new rule object |
|
|
Joe transfers his first asset to Mary, thus the asset's ownedByPersonID changes from 456 to 457 |
|
|
An administrator introduces a new tax threshold, stored as a new rule object |
|
|
An administrator removes an existing tax threshold, thus removing its rule object |
|
|
An administrator publishes changes to the TaxLiabilityBusinessCalculationsRuleSet rule set |
|
|