I have a use case that requires me to know what fields were matched in a decision table and which fields were not matched. I know Drools uses algorithms to identify the matches efficiently and it is not a procedural approach where it checks field after the other, but I am still wondering if it is possible to identify the matching at a field level.
To illustrate on it using a simplified example, consider the following Decision Table: Sample Decision Table
Now, assume that I am using the REST API to submit my facts to obtain the decisions. If I send the following facts:
- Vehicle Type: Car
- Size: Sedan
- Manufacturer: Nissan
- Year Built: 2015
I will not find any match because there is no matching rule that covers year 2015. However, I would like to know that Drools found match(es) for Vehicle Type, Size, and Manufacturer, yet failed to find a match for the Year Built: Here is a little illustration.
What are the suggested approaches to handle this use case?