How to use hit policy in decision table in Drools

647 Views Asked by At

I am using drools decision table to create rules. In the xls file, there are multiple rules to modify the amount of a product by adding eligible tax for a given fact and in that I have to choose only one which return the minimum order amount. In the documentation, it is mentioned that DMN hit policies has been implemented in the 7.x series. The value of C< can be specified in the top left corner of the decision table and. But all the rules are getting fired. What can be done to

I have tries to give the value of C< in the top left corner and in the left most cell of rule table.

I expected that after firing of all the rules, the.minimum order value should have returned. But I am getting multiple order value. Now one workaround could be to pass the objects to a new rule file which will give the minimum of the order amount but I figured that dmn hit policy should have worked in this case.

1

There are 1 best solutions below

0
On

DMN Decision Tables, and Drools' spreadsheet decision tables (xls) are two separate things.

If you want to use the DMN Decision Table because you are interested in the hit policies offered by the DMN standard, fully supported by Drools, you need to produce a DMN model file (.dmn). You can use the Drools DMN editor to build a DMN model. If you are then looking for some documentation on the Drools DMN editor you can reference chapter Creating and editing DMN models in Business Central.

If you want to use instead Drools' spreadsheet decision tables (xls), you can reference chapter Spreadsheet decision tables in the Drools' manual.