F) Custom rule classes for calculations

The calculation of your decision details (and/or sub-screen data) may require complex business recalculation, which may be served by custom "calculator" rule classes.

Typically the implementation of your attributes annotated with Display or DisplaySubscreen will reuse calculation rules which you have already implemented for eligibility/entitlement calculations, although on rare occasions some refactoring of your existing rules may be required to make the common rules suitable for both eligibility/entitlement and decision details purposes.

You may also create new rule classes to accumulate data for display and/or transform data into a format more suitable for display. Your rule classes will have one or more attributes annotated with Display, but may also have non-annotated attributes to hold interim calculation results.

The calculations will typically ultimately retrieve (and thus depend on) entity, evidence or rate data. These dependencies behave in a similar way to those for eligibility/entitlement calculations (see E) Custom rule classes for calculations).