DMN: refactor BaseFEELFunction getCandidateMethod #1370
Labels
area:dmn
Related to DMN
area:engine
Related to the runtime engines
type:tech-debt
Things that were left behind an may harm us in the future.
THe BaseFEELFunction.getCandidateMethod is used to find /by reflection) the beste method to be invoked for BaseFunction execution.
The current implementation iterates over all the
invoke
methods available in the current class, and look for the best match. At the same time, it also "modify/adapt" input parameter, to find a possible "coerced" match (e.g. single item -> singleton list).The problem with the current implementation is that it is hard to modify and somehow fragile, since it is cumebrsome to understand if a given match, found from "coerced" parameter, is actually "best" then another one (there is a score mechanism, but it seems also somehow limited).
BEside all of that, the method itself is a big, untested, black box, and being a critical part of execution, it should be deeped unit-tested.
Scope of this ticket is to revisit the overall implementation and see if it is possible a different, clearer, and extensively tested solution
The text was updated successfully, but these errors were encountered: