Drools- how to find out which all rules were matched?

后端 未结 5 1619
后悔当初
后悔当初 2021-02-02 13:32

I\'ve one .DRL file which has say 10 rules. Once I insert a fact, some rules may be matched- how do I find out which rules were matched programmatically?

5条回答
  •  余生分开走
    2021-02-02 13:42

    Change the dialect to JAVA in DRL file.

    Insert a HashMap from the java file to DRL file (using Drools session concept), which should contain the rule name as key and boolean value as result.

    Follow this link to know how to insert Map to the DRL file.

    You can now find which rule exactly matched.

    Hope this helps :)

提交回复
热议问题