Identify which fields in a decision table did not match the facts

111 views Asked by At

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:

  1. Vehicle Type: Car
  2. Size: Sedan
  3. Manufacturer: Nissan
  4. 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?

0

There are 0 answers