Calculations can reference other attributes within the same instance; they can also reference other attributes in other related instances (ie instances in directly or distantly related classes).
It is possible for the derivation calculation on one attribute, to alter the result of the derivation calculation on another attribute, within the same instance.
To manage this - and to make sure that all instances are fully derived before being written to file - Freedombase provides class level recursion.
Essentially, class level recursion, causes Freedombase to fully derive each attribute within the instance; and then to derive each attribute again; and to keep doing so, until the instance stops changing. This means that the impact of interdependent calculations - calculations dependent on other calculations within the same class - is fully applied before the instance is written.
However, although Freedombase provides this capacity, in most circumstances it is not necessary to use it. Usually, it is sufficient to set the Derivation Sequence on each attribute, causing the attributes to be derived in the most efficient manner. Sequencing is explained further on in this tutorial; only class recursion is explained within this page.
For example, if we stored a delivery cost against each customer, and that delivery cost was derived from the customer's state, we would need to convert the state to uppercase before we could derive the delivery cost.
If the conversion of the state attribute to uppercase occurred after the delivery cost was derived, the delivery cost calculation would probably only work with class recursion.
In this example, Freedombase would derive the delivery cost first, and the state would be converted to uppercase second. The state would have changed, and possibly the delivery cost, so Freedombase would then derive the instance a second time.
The second time, the delivery cost would be derived, and the value would change; the state would be derived, but would not change. The instance has changed, so Freedombase would derive the instance a third time.
No data would change the third time, however, so Freedombase would then stop deriving the instance, and the instance would be ready to be updated into the class, assuming it passed validation rules.
You can set the maximum recursion to use against each class, in the Recurse Levels field for each class. In this case, Freedombase will recursively derive each attribute within that class that number of times, or until the instance stops changing, whichever occurs first.
For the sakes of efficiency, it is usually better to set Recurse Levels to 1, and to use derivation sequencing, as described further on in this tutorial, instead of using class recursion. Only use class recursion when it is specifically required.
| previous | next |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |

