How to initialize null attributes
- Last Updated: December 28, 2020
- 1 minute read
- Corticon.js
- Documentation
Attributes that are used in calculations must have a non-null value to prevent test rule failure. More specifically, attributes used on the right-hand-side of equations (that is, an attribute on the right side of an assignment operator, such as = or +=) are initialized prior to performing calculations. It is not necessary for attributes on the left-hand-side of an equation to be initialized – it is assigned the result of the calculation. For example, when you are calculating Force=Mass*Acceleration, you must provide values for Mass and Acceleration. Force is the result of a valid calculation.
Initialization of attributes is often performed in Nonconditional rules, or in rules expressed in Rulesheets that execute beforehand.