- Each Higson parameter is a decision table consisting of:
- definition of conditions, or input columns,
- definition of outcomes, or output columns,
- a matrix built from input and output cells,
- some meta configuration (matching mode, caching, sorting, etc.).
Each input column (condition) takes a value from some source. There are two types of sources:
- value may be a valid path in the domain model (for example: customer.personal.age is a valid path to a number - the customer's age),
- the value may be taken from an outcome of another parameter or function.
Each condition column has a defined matcher, which is used to check whether the input value matches to a condition. Higson comes with many useful matchers:equals, between, in, not-in, regex, like, contains/all, contains/any, etc.
On the other hand, each output column holds a potential parameter’s value. This potential value will become the outcome if all conditions in the same row evaluate to true.
Higson parameters can return a single value, several values (a vector) or even a matrix of values. In combination with different matchers, different matching modes and input sources, it is quite a powerful tool in a developer’s hands.
The following screenshot presents a real-life example of a parameter defined in Higson Studio.
On the above screenshot you can see a parameter that has 6 conditions and 4 outcomes.Conditions include age and value of the vehicle (between matcher), name of the previous insurer (in matcher) and the insurer’s profile code (default matcher). The Higson rules engine will find the best matching row and return its 4 output values.
Typically, all Higson parameters are fetched from a database and converted into an in-memory index when used for the first time. The in-memory index allows matching rows to be found in a few microseconds. The index structure guarantees O(1) lookups if all conditions use default matchers.
It is not uncommon to see a project with more than 500 parameters (decision tables), with many having more than 100k rows, and some larger than 1 million rows.