0
votes

I have a drools decision table created in excel. I have created a function in the headers section Functions | function boolean checkLimits(Policy policy) { | ...function body... | return false; | } How do I call this function from the CONDITION cell?

I have tried just checkLimits(policy);, Functions.checkLimits(policy); and this.checkLimits(policy); but I get an error all similar to:

text=Unable to Analyse Expression Functions.checkLimits(policy): [Error: unable to resolve method using strict-mode: com.chubb.Result.Functions()] [Near : {... Functions.checkSectionLimits(p ....}]

1

1 Answers

0
votes

I assume you call 'headers section' the place you have defined the RuleSet, Import, Variables, etc. This is the place where the functions should be defined.

For a rule to invoke the function, you should call it on the same column as the ACTION cell and on the second row under the ACTION like in the following screenshot

drools decision table

The function is always called and you can pass the cell's text as a String using $param keyword. In the above example, if the session has the key 'RUL-001' inserted, the RULE-001 will NOT be fired as the function returns false if the code is 'F'.